Advertisement

03.17.2004 at 08:07AM PST, ID: 20922073
[x]
Attachment Details

jdbc - java.sql.SQLException: No suitable driver

Asked by Zephyr__ in Java Programming Language

Tags: ,

Hi, im writing my first ever java application which interacts with a database (and its not going well), i am using MySQL as the DBMS...

When i run my connection code i get the following exception:

Unable to connect.

java.sql.SQLException: No suitable driver

      at java.sql.DriverManager.getConnection(DriverManager.java:532)

      at java.sql.DriverManager.getConnection(DriverManager.java:193)

My connection code is as follows:

            Class.forName(driverClass);
            conn = DriverManager.getConnection(url);

(where driverClass substitutes for a string: "com.mysql.jdbc.Driver";
conn = a Connection
url is a series of concatenated string variables which add up to make the url.)

Can someone who knows more about this give me some help please? And also i have set up mysql with a database called gamesdb, the url in the above code requires a username and password (i have not set one up in mysql) should i leave username and password out of my url?

I have consulted many online tutorials but they dont tell me properly what drivers i need and where to actually put them on my system.

zephy

Start Free Trial
[+][-]03.17.2004 at 08:09AM PST, ID: 10616316

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:09AM PST, ID: 10616324

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:11AM PST, ID: 10616341

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:13AM PST, ID: 10616358

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:15AM PST, ID: 10616375

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:20AM PST, ID: 10616422

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Java Programming Language
Tags: suitable, driver
Sign Up Now!
Solution Provided By: Nick_72
Participating Experts: 2
Solution Grade: A
 
 
[+][-]03.17.2004 at 08:25AM PST, ID: 10616475

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:30AM PST, ID: 10616518

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:31AM PST, ID: 10616524

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:31AM PST, ID: 10616529

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:42AM PST, ID: 10616628

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:43AM PST, ID: 10616629

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:45AM PST, ID: 10616653

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:50AM PST, ID: 10616685

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:50AM PST, ID: 10616688

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:50AM PST, ID: 10616691

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]03.17.2004 at 08:51AM PST, ID: 10616695

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32