ConnectionException: null (in com.mysql.jdbc.Connection)
Posted by: abyssnolf
Date: March 05, 2005 05:18PM

Pretty new to mySQL, so I've been trying to run my first java program that connects to the database, and this error occurs everytime I try to connect. I'm using the Connector/j 3.1.7 and the newest version of MySQL. The problem occurs in the last of the following lines of code:

String url= "";
try {
url = "jdbc:mysql://" + host + "/" + database + "?user=Scooby&password=****";
Connection con = DriverManager.getConnection(url);

And I'm not sure where to go from there. I do check the driver with Class.forName... and it seems to work out. One thing I can't seem to do is connect to mySQL from the command line (windows xp pro) by simply typing "mysql" or "mysql -p". I just get an error 2003. Any help is appreciated.


Options: ReplyQuote

Written By
ConnectionException: null (in com.mysql.jdbc.Connection)
March 05, 2005 05:18PM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.