Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7627851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:30:58+00:00 2026-05-31T05:30:58+00:00

I have previous JSP experience but with using Tomcat and Resin and I would

  • 0

I have previous JSP experience but with using Tomcat and Resin and I would like to connect to a mySQL database using Glassfish and hoped that more or less copy and pasting the code would work.

The code is:

try {
        Class.forName("org.gjt.mm.mysql.Driver");
    } catch (Exception E) {
        System.out.println("First: " + E);
    }

Connection conn = DriverManager.getConnection("jdbc:mysql://xxx.xx.xx.xx:xxxx/DBName", "Username", "Password");

The errors I get when I look into my server logs are

[#|2012-03-09T13:50:21.900+0000|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=67;_ThreadName=Thread-1;|First:
java.lang.ClassNotFoundException: org.gjt.mm.mysql.Driver|#]

[#|2012-03-09T13:50:22.009+0000|INFO|glassfish3.1|javax.enterprise.system.std.com.sun.enterprise.server.logging|_ThreadID=67;_ThreadName=Thread-1;|java.sql.SQLException:
No suitable driver found for
jdbc:mysql://xxx.xx.xx.xx.xx/SmarterStudents|#]

I have put the mysql-connector-java-5.0.7-bin.jar into the domain/lib folder and threw it into the WEB-INF/lib folder just to be safe and it still wouldn’t work for me.

I’m at my wit’s end now, I just don’t know what to do. D:

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:30:58+00:00Added an answer on May 31, 2026 at 5:30 am

    You’re using the old and deprecated driver class name for the very first releases of the MySQL JDBC driver org.gjt.mm.mysql.Driver when it was still a hobby project, while you’re using one of the more recent releases of the MySQL JDBC driver which has the driver class name com.mysql.jdbc.Driver.

    Fix the classname accordingly.

    Class.forName("com.mysql.jdbc.Driver");
    

    Make sure that you’re reading the official MySQL JDBC driver documentation instead of some random and heavily outdated resource/book/tutorial.

    As to the placement of the JAR file, when you’re managing the connections yourself in your web application, the JAR can be placed in both server’s own /lib or webapp’s /WEB-INF/lib. But when you’re letting the server manage the connections (which will usually use a shared connection pool which is way much faster), then the JAR must be placed in server’s own /lib folder. The one in the deployed webapp(s) will be ignored anyway.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am writing a simple database with web access. I have previous experience with
I have previous experience with MATLAB, but the problem that I face is some
I have created a JSP test framework but running into this issue if I
here I would like to execute both javascript and JSP after onclick event <CODE>
Migrating from PHP to EJB , I have previous experience of PHP , C++
I have to retrieve the more than 100 records from the Database table using
I have a little project with some jsp deployed on an Tomcat 5.5. Recently
I have a previous and a next link on my website which I would
I have .frm, ibdata and ib_logfile from my previous version of MySQl and now
First question on stackoverflow. I have no previous experience of running a high traffic

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.