Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting an Exception wile accessing data

 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I'm just trying to access data for testing purpose only.

For this i have created mysql data "test" and created a table "country" (srno, countryname).

I have created following java class and trying to pull filed values from above table country.

ShowParameters.java



But i'm getting following Exception.



I'm using NetBeans 6.1 to create mysql database and java class.

Could anyone please tell me what is going wrong in above source code.

Thanks in Advance.
 
Henry Wong
author
Sheriff
Posts: 22607
111
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The mysql (jdbc driver) jar file is not in your class path. You need to configure netbeans to include it.

Henry
 
Jay Shukla
Ranch Hand
Posts: 214
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Henry,

Thanks a lot for reply. Could you let me the exact name of the jar so that i can add it.
 
Rob Spoor
Sheriff
Posts: 20827
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://dev.mysql.com/downloads/connector/j/5.1.html
 
Campbell Ritchie
Marshal
Posts: 53108
124
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Maybe late, but this would sit better on our databases forum. Moving.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!