Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2003

    Question Unanswered: simple JSP connect MySQL error

    I'm receiving this error:
    java.lang.ClassNotFoundException: com.mysql.jdbc.Driver is an unknown class

    My .bashrc and .bash_profile files have the PATH and CLASSPATH formatted like:

    My db connection is like:
    Class.forName("com.mysql.jdbc.Driver").newInstance ();
    Connection conn = DriverManager.getConnection("jdbc:mysql://");
    Statement stmt = conn.createStatement();

    The error is obviously caused by the jvm not being able to locate the driver... but I'm not sure why it can't find it with the above information specified.

    Any help would be greatly appreciated !
    Thanks !

  2. #2
    Join Date
    Oct 2003

    Exclamation fixed

    *phew... it is fixed now ... resolution:

    I'm running Resin, and probably just like any other Servlet/JSP server, you need to have the MySql driver located in the /lib directory.

    I don't know exactly which /lib directory was needed, but I put it in every /lib directory I had in my $JAVA_HOME install dir, and in every /lib directory in my Servlet/JSP server installation.
    (including WEB-INF/lib/)

Posting Permissions

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