Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC/Servlets question

 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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???
 
Jan Cumps
Bartender
Posts: 2588
11
C++ Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Duran Harris
Ranch Hand
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 874
Android Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



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
Posts: 608
Eclipse IDE Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic