#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Bloomington, IN U.S.A.
    Posts
    23
    Rep Power
    0

    Unhappy JSP MySQL Connectivity Problem


    Hey,

    I am having a problem retrieving data from my DB via my JSP. I know that MySQL, Tomcat and Apache are all functioning correctly independently. However, I don't know if I have Connector J configured correctly. Right now the Connector J 3.0.8 jar file is located in my Java extensions folder. I have not done anything with environment variables. NO CLASSPATH and NO JAVA_HOME. I am having this problem on Mac OS X. I have successfully run all my code on PC. I am running:

    MySQL 3.23.51
    Tomcat 3.2.4
    OS X Jaguar Server
    J2SE 1.3.1

    I'm using this for a connection:

    Class.forName("org.gjt.mm.mysql.Driver").newInstance();
    conn = DriverManager.getConnection("jdbc:mysql://localhost/dandi");

    I know that my jsp code is running correctly since it is printing my exception in the browser. The connection to sql is simply not happening and I know it is a result of my ignorance on this subject. Any guidance would be greatly appreciated. Thanks
  2. #2
  3. No Profile Picture
    Moderator =(8^(|)
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2002
    Location
    Sacramento, CA
    Posts
    1,710
    Rep Power
    14
    Are you getting a ClassNotFound exception for org.gjt.mm.mysql.Driver?
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2003
    Location
    No es importante
    Posts
    2,065
    Rep Power
    14
    Place the mysql jdbc jar file in the classes folder of the web-inf folder for the web project or place it in the class loader if you want to use it for all projects.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Bloomington, IN U.S.A.
    Posts
    23
    Rep Power
    0
    Reply 1. Yes, I am getting the ClassNotFound exception for the Driver.

    Reply 2. The mysql jdbc jar file? Is that the same as the connector J driver? I will try to move the connector J file in there in the morning.

    Thanks!!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Bloomington, IN U.S.A.
    Posts
    23
    Rep Power
    0
    Thanks for the suggestion. This worked.

IMN logo majestic logo threadwatch logo seochat tools logo