MYSQL connector

public void firstConnection()

{

try

{

Connection conn =

DriverManager.getConnection

("jdbc:mysql://localhost:test?" +

"user=root&password=secret");

System.out.println("Got Connection");

does not get to the system.out.println, claiming

SQLException: No suitable driver

SQLState: 08001

VendorError: 0

I have put the connector on the classpath and have typed in both their test version and the actual port it's on.

Can you help please?

[531 byte] By [burntcandlea] at [2007-11-27 6:22:28]
# 1
Re-read the documentation how the JDBC URL ought to look like.
BalusCa at 2007-7-12 17:39:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 2
Are you loading the driver anywhere?
cotton.ma at 2007-7-12 17:39:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...
# 3

SQLException: No suitable driver

Add the MySQL JDBC driver in classpath.

Load the JDBC driver.

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

Obtain a JDBC connection.

Connection conn=

[DriverManager.getConnection ("jdbc:mysql://localhost:3306/test",

"root", "password");

dvohra09a at 2007-7-12 17:39:30 > top of Java-index,Database Connectivity,Java Database Connectivity (JDBC)...