<%
Class.forName("com.ibm.db2.jcc.DB2Driver");
System.out.println("driver loaded sucesssssssssssssssssss");
Connection
Conn=DriverManager.getConnection("jdbc:db2://localhost:50000/VOTERS","db2admin","friends");
String Login_name=request.getParameter("Login Id");
String Password_id=request.getParameter("Password");
PreparedStatement Stmt=Conn.prepareStatement("SELECT NAME FROM
LOGINDETAILS WHERE LOGIN ID='"+Loginname+"' AND PASSWORD='"+Password_id+"'");
System.out.println("Statement loaded sucesssssssssssssssssss");
Stmt.executeQuery();
ResultSet rs=Stmt.getResultSet();
System.out.println("query execute loaded sucesssssssssssssssssss");
String name= null;
while(rs.next())
{ Login=rs.getString(1);
}
rs.close();Stmt.close();Conn.close();
if(name != null)
out.println("Welcome to "+login);
else
out.println("Please check your Login Id and Password...");
%>
Ads