If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Problem trying to execute query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-21-05, 00:04
Souma Souma is offline
Registered User
 
Join Date: Oct 2005
Posts: 2
Problem trying to execute query

I have a class created specially for mysql DB connection (DBUtil.java) and i have a servlet (LoginServlet.java) for login and it is where the query is to be execute. But sadly, it gives me error "NullpointerException" (Error.gif) and point to the line of code "PreparedStatement ps = conn.prepareStatement(sql);"

And now i dunno what's wrong, can someone help?

1) I'm not sure if i using the correct driver and url for my DB, but i tested it before and it connected. Check out DBUtil.java
2) Don't know if there is/are anything wrong with the codes, refer to LoginServlet.java

All required information are in the attachment (Resources.zip)

Thanks in advance.
Attached Files
File Type: zip Resources.zip (34.1 KB, 15 views)
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On