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 6206687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:29:36+00:00 2026-05-24T05:29:36+00:00

Hi i have found a seemingly common problem, i cant interact with a mysql

  • 0

Hi i have found a seemingly common problem, i cant interact with a mysql db. This no suitable driver found keeps happening.
I have followed most threads on this same question, however i was not able to replicate their solution so am posting my own specific question.

(Mostly this thread: I can't load the JDBC driver for MySQL)

My code:

public DBManager(){
    try {
        //Class.forName("com.mysql.jdbc.Driver");
        DriverManager.registerDriver(new com.mysql.jdbc.Driver()); 

        con=DriverManager.getConnection("jdbc:mysql:3306//localhost/test","root","root");
        //con=DriverManager.getConnection(c);
        if(!con.isClosed()) {
            con.close();
        }
    }
    catch (SQLException e) {
        e.printStackTrace();
    }

Now, i read that on newer drivers you dont need either Class.forName () or registerDriver();
i have tried both and i still cant get it to work.

The thing is am developing on a windows machine, with eclipse Indigo and Connector/J 5.1.17

and deploying (and debugging) on a remote linux with the same Connector.

Am launching my debug sessions with

java -Xdebug -Xrunjdwp:transport=dt_socket,address=8998,server=y -classpath /home/dev/mysql-connector-java-5.1.17-bin.jar -jar devserver.jar

and i get that exception. Any help?

I come from a heavy c# development environment, so if i have to meddle with classpaths and such please try to step it by step as im not very familiar with that.

  • 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-24T05:29:37+00:00Added an answer on May 24, 2026 at 5:29 am

    SQLException: no suitable driver

    You will get this exception whenever the DriverManager#getConnection() cannot find a suitable driver for the given connection URL. This in turn happens when the Driver#acceptsURL() has returned false for any of the loaded drivers.

    And indeed, your connection URL is wrong:

    jdbc:mysql:3306//localhost/test

    It should have been:

    jdbc:mysql://localhost:3306/test

    See also the MySQL JDBC manual.

    The JDBC URL format for MySQL Connector/J is as follows, with items in square brackets ([, ]) being optional:

    jdbc:mysql://[host][,failoverhost...][:port]/[database] »
    [?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
    

    If the host name is not specified, it defaults to 127.0.0.1. If the port is not specified, it defaults to 3306, the default port number for MySQL servers.

    jdbc:mysql://[host:port],[host:port].../[database] »
    [?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]...
    

    If the database is not specified, the connection will be made with no default database.

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

Sidebar

Related Questions

I am finding many solutions to this seemingly common problem, but alas, none seem
I have been trying to get this seemingly simple problem fixed for about half
This is a particular problem that I have come across many times, but I
I have been working on this problem for a while but still no joy.
I have found some sample code on codeproject that allows for user impersonation. This
I've tested the following seemingly simple query on MySQL 5.0, 5.1, 5.5 and found
First post, have found many answers here, so hopes are high. The problem: Google
I have a problem that is seemingly solvable by enumerating all possible solutions and
I have found some in the Cappuccino website (vim, textmate and SubEthaEdit), but not
I have found that my HTML is, to be honest, very clunky. Small, simple

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.