Results 1 to 2 of 2

Thread: mysql java

  1. #1
    Join Date
    Jul 2003
    Posts
    2

    Red face Unanswered: mysql java

    Hi
    i am trying to get connection with mysql by using java. when i try to compile java code it gives following compilation error

    "testSQL.java:29: cannot access Connection bad class file: .\Connection.class class file contains wrong class: org.gjt.mm.mysql.jdbc2.Connection Please remove or make sure it appears in the correct subdirectory of the classpath.
    Connection con = DriverManager.getConnection(url, username ,pass);

    my code is :
    Class.forName("org.gjt.mm.mysql.Driver1");
    String username = "na_e2002";
    String password = "Eclipse";
    String url = "jdbc:mysql://mysql.it-c.dk" + username;
    Connection con = DriverManager.getConnection(url, username , pass);

    how i can remove this problem.
    thanks in advance

  2. #2
    Join Date
    Jan 2003
    Location
    Paris, France
    Posts
    320
    The driver class is org.gjt.mm.mysql.Driver not org.gjt.mm.mysql.Driver1 and is's the old jsbc driver
    you may use the new one com.mysql.jdbc
    Olivier Miossec
    --
    http://www.lasso-developpeur.net/
    --

Posting Permissions

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