List:MySQL and Java« Previous MessageNext Message »
From:Steve Gere Date:February 11 2003 5:37pm
Subject:RE: No suitable driver error
View as plain text  
Shankar
Thank you so much for finding what my stupid eyes did not see. I saw those
// in the readme file but in my mind's eye had them inside the brackets and
therefore optional. I changed the code to your second example (and included
the port number) and everything works fine.
Steve


-----Original Message-----
From: Shankar Unni [mailto:shankar@stripped]
Sent: Tuesday, February 11, 2003 9:04 AM
To: java@stripped
Subject: RE: No suitable driver error


> Connection conn = DriverManager.getConnection("jdbc:mysql:TestDB");

That's not what a valid JDBC URL looks like for MySQL. The official spec
is:


jdbc:mysql://[hostname][:port]/dbname[?param1=value1][&param2=value2]...

The shortest form of this for you, if the client is on the same host as
the mysql server, is

  jdbc:mysql:///TestDB

It's better form to mention at least the hostname, though, to make this
explicit:

  jdbc:mysql://localhost/TestDB

Unfortunately the only documentation available for Connector/J is on the
sourceforge site for an old version of mm.mysql driver:

  http://mmmysql.sourceforge.net/doc/mm.doc/book1.htm.

Mark: the www.mysql.com site has *no* pointers to this documentation.
Any chance of getting an updated version of this documentation into the
mysql.com site?


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/doc/         (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <java-thread5027@stripped>
To unsubscribe, e-mail <java-unsubscribe-sgere=pacbell.net@stripped>



Thread
Possible connection problem with Connector/Jjlafontaine@lyon-partdieu.sema.slb.com)7 Feb
  • No suitable driver errorSteve Gere10 Feb
    • RE: No suitable driver errorShankar Unni11 Feb
      • Re: No suitable driver errorMark Matthews11 Feb
      • RE: No suitable driver errorSteve Gere11 Feb