Results 1 to 2 of 2
  1. #1
    Join Date
    Sep 2003
    Location
    CA
    Posts
    38

    Unanswered: 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

  2. #2
    Join Date
    Dec 2003
    Posts
    1

    Can't Find Driver

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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •