If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Mysql & JDBC configuration

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-06-03, 17:19
poojajt poojajt is offline
Registered User
 
Join Date: Sep 2003
Location: CA
Posts: 38
Mysql & JDBC configuration

Hi,
Am writing code for connecting to MYSQL database 'n here is what I've coded...
Class.forName("com.mysql.jdbc.Driver") ;
Connection conn = DriverManager.getConnection("jdbc:mysql://localhost/email") ;

Statement stmt = conn.createStatement() ;

As per the documentation of the MYSQL-JDBC driver for Linux u've to
Put mysql-connector-java-3.1.0-alpha-bin.jar in your classpath, either by adding the
FULL path to it to your CLASSPATH enviornment variable, or putting it in $JAVA_HOME/jre/lib/ext....so i copied the file to the /jre/lib... folder but inspite of that I've the foll. error......i.e. it is not able to detect the
driver......
db_test.java:15: unreported exception java.lang.ClassNotFoundException; must be
caught or declared to be thrown
Class.forName("com.mysql.jdbc.Driver") ;
^
1 error

How do i get out of this? Please help asap.
Thanx.
Pooja
Reply With Quote
  #2 (permalink)  
Old 12-25-03, 22:22
BWDRKR2 BWDRKR2 is offline
Registered User
 
Join Date: Dec 2003
Posts: 1
Can't Find Driver

Did you find the solution to find the driver ? I have the same problem.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On