20 messages in com.mysql.lists.javaRe: MM JDBC Driver with MySQL
FromSent OnAttachments
Lawrence, Gareth25 Mar 2002 18:56 
Lawrence, Gareth25 Mar 2002 20:09 
Fabian Sommer26 Mar 2002 01:40 
Rakesh26 Mar 2002 02:10 
Fabian Sommer26 Mar 2002 03:38 
Fabian Sommer26 Mar 2002 04:15 
Adnan Al-bar26 Mar 2002 04:43 
Leo Przybylski26 Mar 2002 07:19 
Mark Matthews26 Mar 2002 10:03 
Mark Matthews26 Mar 2002 10:08 
Tom Myers26 Mar 2002 12:53 
Bruce Scharlau26 Mar 2002 13:00 
Lawrence, Gareth26 Mar 2002 13:36 
Bruce Scharlau26 Mar 2002 13:59 
Mark Matthews26 Mar 2002 14:33 
Bruce Scharlau26 Mar 2002 16:01 
Bruce Scharlau26 Mar 2002 16:27 
Tom Myers26 Mar 2002 18:08 
Tye, Timothy27 Mar 2002 11:38 
Fabian Sommer10 Apr 2002 23:56 
Subject:Re: MM JDBC Driver with MySQL
From:Bruce Scharlau (scha@csd.abdn.ac.uk)
Date:03/26/2002 04:01:37 PM
List:com.mysql.lists.java

Fabian,

have a look below. I suspect from your code sample that you've put in the wrong URL for the connection.

Compare it to what you have under the w98 version, and you'll probably find a typo.

See more specifics below.

At 12:39 PM 3/26/2002 +0100, you wrote:

Hi Bruce, hi Rakesh!

I've tried various versions of mm.mysql, 2.0.4,2.0.6, 2.0.8 and 2.0.11 - i always use the JSDK1.3 for the java environment. The classpath to the mm.mysql-driver is set correctly, as i can load the driver in my application. When i get an SQL-Exception at the moment i And i have tested my code, it's running under

Also set the port no 3306 along with your IP to the server. ie something like 192.168.0.2:3306.

4. Use an appropriate driver url for the application, ie jdbc:mysql://hostname/databasename?user=<username>&password=<password> Note: Sometimes you need to supply a proper DNS number instead of using localhost, ie 192.168.0.2, or whatever, and if there is no password, then leave it empty, but still put the password= part in the url.

- done I'm working with a fix ip-number, the mysql-server i use is no longer localhost, as it has been in the first

Here i have the text of an older message posted here, it's been the thread with the issue:"Problem using mm-mysql and win2k" ("Re:Problem...") and started on March, 6th 2002. Mark Matthews and Ylan Segal were the ones who answered my questions, and they asked nearly the same you asked me today.

This part looks ok, but ...

try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); System.out.println("ok"); } catch (Exception E) { System.err.println("Unable to load driver."); E.printStackTrace(); } ... i get the "ok" printed to system.out And that's the point where i try to establish a connection to the server:

The url below looks wrong, ie you have passed three parameters to a method expecting two: you have user=root password= &db=Seminare2002

That could be a typo as you say for your email client, but check it out. You only need to have the user and password, item as you pass the database name earlier in the URL, ie the hostname/databasename part.

private boolean mysqllogon (String lname,String lpwd) { try { this.con = DriverManager.getConnection ("jdbc:mysql://139.174.135.20/Seminare2002?user=root&password=&db=Semi nare2002"); } catch (Exception E) { E.printStackTrace(); System.exit(1); } The application exits and the "E.printStackTrace();" produces the error-message copied to the begin of this mail. I hope it doesn't matter that my current webmailinterface doesn't show appropriate formatted code. I think important is that i can register the driver, and that i get a SQLException when i first try to connect to my database. Thanks for your help! Fabian -

Thanks for dealing with this problem! Fabian

Cheers,

Bruce