This week's book giveaway is in the General Computing forum.
We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line!
See this thread for details.
The moose likes JDBC and the fly likes Getting an Exception wile accessing data Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Databases » JDBC
Reply Bookmark "Getting an Exception wile accessing data" Watch "Getting an Exception wile accessing data" New topic
Author

Getting an Exception wile accessing data

Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
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

Joined: Sep 28, 2004
Posts: 16815
    
  19

The mysql (jdbc driver) jar file is not in your class path. You need to configure netbeans to include it.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Jay Shukla
Ranch Hand

Joined: Jun 08, 2008
Posts: 214
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

Joined: Oct 27, 2005
Posts: 19232

http://dev.mysql.com/downloads/connector/j/5.1.html


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32833
    
    4
Maybe late, but this would sit better on our databases forum. Moving.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Getting an Exception wile accessing data
 
Similar Threads
Cant connect to oracle.
connection not possible, even after using the connector
mysql connection problem
java oracle conectivity
Unable to connect to mySQL DB.