File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes JDBC/Servlets question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "JDBC/Servlets question" Watch "JDBC/Servlets question" New topic
Author

JDBC/Servlets question

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Hi all,
I found the following code online...I would like to know why it is throwing a nullpointer exception..I have installed mysql and created a products database as well as a Product table....Please help,I want to use the JSTL <c:sql> tags but I first need to get mySQL up and running...




Except the only difference in mine is that I have different parameters for this:
DriverManager.getConnection("jdbc:mysql://localhost:3036/products","myusername","mypassword");


I don't have the JDBC driver installed though,mySQL site keeps on asking me to enter the same information....
Which version of the JDBC driver must I download??I understand it must go in {$CATALINA_HOME}\common\lib???


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2476
    
    7

I would like to know why it is throwing a nullpointer exception
Can you tell us at what point the exception occurs, and give us the error details?


OCUP UML fundamental and ITIL foundation
youtube channel
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

I edited my first post to highlight some changes in the code that I used...Also I ask about some information on JDBC driver type/and where it must go...
Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874




don't have the JDBC driver installed though,mySQL site keeps on asking me to enter the same information....
Which version of the JDBC driver must I download??I understand it must go in {$CATALINA_HOME}\common\lib???


You can download the JDBC driver jar from here . Also check if the versions match with MySql DB.

Yes , it can go inside common/lib.
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Does this output from javaDB's sysinfo.bat mean that I don't need to install the JDBC connector??

--------- Derby Information --------
JRE - JDBC: Java SE 6 - JDBC 4.0
[C:\Sun\SDK\javadb\lib\derby.jar] 10.4.2.1 - (706043)
[C:\Sun\SDK\javadb\lib\derbytools.jar] 10.4.2.1 - (706043)
[C:\Sun\SDK\javadb\lib\derbynet.jar] 10.4.2.1 - (706043)
[C:\Sun\SDK\javadb\lib\derbyclient.jar] 10.4.2.1 - (706043)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC/Servlets question
 
Similar Threads
sql error
Verify/deny a new user to MySQL via Servlet
Problem with DbConnectionBroker
Hard time learning Servlets
servlet-jdbc help!!!!!!!!!!!!!!!