Hi Scott,

You must register the driver first. Example :

        import com.mysql.jdbc.Driver;

        ...

        public Connection getConnection () throws SQLException {
                DriverManager.registerDriver (new Driver());
                Connection conn = DriverManager.getConnection
("jdbc:mysql://localhost:3306/test","root","root");
                return conn; 
        } 

        ...

-----Original Message-----
From: Scott D. Spiegler [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, May 25, 2004 6:37 PM
To: [EMAIL PROTECTED]
Subject: Unable to Programatically Create DB Connection

I am trying to programatically connect to my DB, but I
am not sure what the connection string should be. I am
using this statement:

conn =

DriverManager.getConnection("jdbc:mysql://localhost/test?user=scott&pass
word=cuatro");

 I am getting this exception message:
 
 database_test.DBConnector 
 SQLException: No suitable driver
 
 SQLState: 08001
 
 VendorError: 0
  
 Any idea as to what the correct, connection string
 might be?
 
 Thanks, Scott

=====
We don't see things as they are, we see things as we are.
    --Anais Nin


        
                
__________________________________
Do you Yahoo!?
Friends.  Fun.  Try the all-new Yahoo! Messenger.
http://messenger.yahoo.com/ 

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to