| | |
stmt from db_connect tutorial isn't working
Please support our MySQL advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Aug 2007
Posts: 238
Reputation:
Solved Threads: 0
Topic
The topic of this question is: db_Connect does not connect.
Hello and Thank you in advance for any assistance.
System info:netbeans project,database attached or provided at:
http://cid-b5cb457363230793.skydrive...lic/school.zip
The purpose of this post is: Try to get a sql statement to work
The functionality of this code is:
My question concerning this code is:
What is wrong with the sql statement provided in tutorial. Or a description of its function .
The errors related to this code are:
Note:
I was told to add table qualifiers to the where clause.
What does this mean. Maybe if someone could break down what the statement is saying (laymens terms) I could fix it.
Thanks again.
-ceyesuma
The topic of this question is: db_Connect does not connect.
Hello and Thank you in advance for any assistance.
System info:netbeans project,database attached or provided at:
http://cid-b5cb457363230793.skydrive...lic/school.zip
The purpose of this post is: Try to get a sql statement to work
The functionality of this code is:
MySQL Syntax (Toggle Plain Text)
· "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))";
My question concerning this code is:
What is wrong with the sql statement provided in tutorial. Or a description of its function .
The errors related to this code are:
MySQL Syntax (Toggle Plain Text)
Initializing Sun's JavaServer Faces implementation (1.2_04-b22-p05) for context '/school' Initialize <------------>jdbcDriver<------------> 12345678<------------>12345678 SQLException:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'user u,usergroup ug WHERE uid='12345678' AND password='12345678' AND groupName I' at line 1 Error on DB return java.lang.NullPointerException at servlets.LoginServlet.doPost(LoginServlet.java:82)
Note:
I was told to add table qualifiers to the where clause.
What does this mean. Maybe if someone could break down what the statement is saying (laymens terms) I could fix it.
Thanks again.
-ceyesuma
•
•
Join Date: Sep 2009
Posts: 1
Reputation:
Solved Threads: 0
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
Code description: my new statement
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:
Thanks again.
-ceyesuma
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
MySQL Syntax (Toggle Plain Text)
"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
MySQL Syntax (Toggle Plain Text)
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:
MySQL Syntax (Toggle Plain Text)
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
![]() |
Similar Threads
- stopping the script (PHP)
- Need help with starting this code (Java)
- Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource (PHP)
- validatong combo value in asp.net using js (JavaScript / DHTML / AJAX)
- mysql_num_rows() error (PHP)
- Cherrypy tutorial is not working (Python)
- Help (again) on a modify record script (PHP)
- Java Compiler not working (Java)
- continuous string (C)
- php wont submit data into the database (PHP)
Other Threads in the MySQL Forum
- Previous Thread: Two table troubles
- Next Thread: Encrypt and decrypt an existing column
| Thread Tools | Search this Thread |
agplv3 alfresco amazon api artisticlicense aws bizspark breathalyzer camparingtocolumns changingprices cmg communityjournalism contentmanagement contractors copyright count court crm database design developer development distinct drupal dui ec2 email enterprise eudora facebook form foss gartner gnu government gpl greenit groupware hiring hyperic images innerjoins insert ip joebrockmeier join keyword keywords kickfire laptop law legal license licensing linux maintenance managing mariadb matchingcolumns metron micromanage microsoft microsoftexchange mindtouch montywidenius mozilla multiple music mysql mysqlcolumnupdating mysqldatetimeordermax() mysqlindex mysqlinternalqueries mysqlquery mysqlsearch news open-xchange opendatabasealliance opengovernment opensource oracle penelope priceupdating query referencedesign reorderingcolumns resultset saas select sharepoint simpledb sourcecode spotify sql sugarcrm syntax techsupport thunderbird transparency virtualization





