• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

JDBC/Servlets question

 
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???
 
Bartender
Posts: 2658
19
Netbeans IDE C++ Linux
  • 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...
 
Ranch Hand
Posts: 874
Android VI Editor Java
  • 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)
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic