Hi,
I'm trying to connect to a MySQL DB (on a Linux machine) from a Java app
that I'm writing on a Win 32 machine via ODBC (MySQL ODBC 3.51 driver).
It fails --throwing an exception-- at the getConnection stage, the
exception says 'No suitable driver'.
Here's my connection string, am I formatting it wrong?
String url = "jdbc:odbc:mysqlFilms";
Connection con = DriverManager.getConnection(url);
// also tried
// Connection con = DriverManager.getConnection(url, "user", "pass");
'mysqlFilms' is the name of the 'user data source' in windows's ODBC 'data
source administrator'. I've spelt it correctly (!) and the 'mysqlFilms'
entry tests correctly within the ODBC 'data source administrator' and
works fine from a C#/.net database client I wrote.
Any suggestions?
Thanks,
MS
Mark Matthews - 31 Jan 2005 19:57 GMT
> Hi,
>
[quoted text clipped - 21 lines]
>
> MS
MS,
You _really_ don't want to use the JDBC:ODBC bridge. I suggest you grab
a copy of the latest version of the MySQL JDBC driver (it's called
'Connector/J'), and install it. It'll be much easier to use, and more
stable.
See http://dev.mysql.com/downloads/connector/j/3.1.html
Regards,
-Mark
MS - 31 Jan 2005 23:10 GMT
Mark Matthews emailed this:
>>Hi,
>>
[quoted text clipped - 34 lines]
>
> -Mark
Ok thanks Mark.