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.get
Connection
(DriverMan
ager.java:
532)
at java.sql.DriverManager.get
Connection
(DriverMan
ager.java:
193)
My connection code is as follows:
Class.forName(driverClass)
;
conn = DriverManager.getConnectio
n(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