My database name is TEST
usename is db2inst1
password is db2inst1
table name is USERS
when i execute this code i get
com.ibm.db2.jcc.b.nm: DB2 SQL Error: SQLCODE=-204, SQLSTATE=42704,
SQLERRMC=DB2INST1.USERS, DRIVER=3.50.152
please help
String username=request.getParameter("user");
username.trim();
String password=request.getParameter("pass");
password.trim();
Connection con=null;
try{
Class.forName("com.ibm.db2.jcc.DB2Driver");
con =
DriverManager.getConnection("jdbc:db2://localhost:50000/TEST","db2inst1","db2inst1");
out.println("connection made\n");
out.println("0");
Statement stmt = con.createStatement();
out.println("1");
ResultSet rs = stmt.executeQuery("SELECT * FROM USERS
WHERE USERNAME='"+username+"'");
out.println("2");
if(rs.next())
{
String pass = rs.getString("PASSWORD");
if(pass.equals(password))
{
out.println("login successful");
}
}
}catch(Exception e){out.println(e.toString());
}
--
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
[email protected]
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscribegooglegroups.com or reply to
this email with the words "REMOVE ME" as the subject.