Topic
The topic of this question is: db_connect+my stmt
Hello and Thank you in advance for any assistance.
System info:
Noted in previous post.
The purpose of this post is:
Display supplied stmt from above mentioned tutorial. Stmt throws an error as noted in previous post.
Display my new stmt.
Code description:supplied stmt
"SELECT u.uid, firstName, lastName, address1, address2, city, postCode, email, phone, ug.groupName as userGroup "
+"FROM user u, usergroup ug WHERE uid='"+userName+"' AND password='"+password+"' AND groupName IN"
+" (SELECT groupName FROM usergroup WHERE groupid =(SELECT groupid FROM usergroup_mapping WHERE uid=u.uid)
Code description: my new statement
String strQuery = "SELECT u.uid, u.password,ug.groupName FROM user AS u,usergroup AS ug,usergroup_mapping AS ugm WHERE u.uid='userName' AND u.password='password' AND u.uid=ugm.uid AND ugm.groupid=ug.groupid";
My question concerning this code is:
If my new stmt produces the required field when I run it on the databases. Why doesn’t the login except username=10101010 password =StealthProject which is in the data base?
The errors related to this code are:
my new stmt:
Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context '/school'
Initialize <------------>jdbcDriver<------------>
10101010<------------>StealthProject
Error on DB return
java.lang.NullPointerException
at servlets.LoginServlet.doPost(LoginServlet.java:82)
Thanks again.
-ceyesuma