Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / December 2007

Tip: Looking for answers? Try searching our database.

How to connect to a remote MySQL database using Java

Thread view: 
madhura - 15 Dec 2007 02:26 GMT
Hi,

I am trying to connect to a remote MySQL database using Java.  I used
the driver org.gjt.mm.mysql.Driver but it doesn't seem to help.  I
would appreciate if anybody could guide me through this as I am
learning programming.

Thank you,

Best,
Madhura
Thomas Kellerer - 15 Dec 2007 08:19 GMT
madhura wrote on 15.12.2007 03:26:
> Hi,
>
> I am trying to connect to a remote MySQL database using Java.  I used
> the driver org.gjt.mm.mysql.Driver but it doesn't seem to help.  I
> would appreciate if anybody could guide me through this as I am
> learning programming.

http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html
Lew - 15 Dec 2007 17:56 GMT
> madhura wrote on 15.12.2007 03:26:
>> Hi,
[quoted text clipped - 5 lines]
>
> http://dev.mysql.com/doc/refman/5.0/en/connector-j-usagenotes-basic.html
T

Madhura - take note that you're aiming for the wrong driver.  You want
com.mysql.jdbc.Driver.

Signature

Lew

Arne Vajhøj - 15 Dec 2007 18:23 GMT
>> madhura wrote on 15.12.2007 03:26:
>>> I am trying to connect to a remote MySQL database using Java.  I used
[quoted text clipped - 6 lines]
> Madhura - take note that you're aiming for the wrong driver.  You want
> com.mysql.jdbc.Driver.

org.gjt.mm.mysql.Driver was the original MySQL JDBC driver developed
by Mark Matthews in 1998.

In 2002 he joined MySQL and the driver became the basis for
the official MySQL JDBC driver.

A lot of documentation still refer to the old driver name.

And it still works - even new distributions from MySQL
has:

package org.gjt.mm.mysql;

import java.sql.SQLException;

public class Driver extends com.mysql.jdbc.Driver {
    public Driver() throws SQLException {
        super();
    }
}

I think using com.mysql.jdbc.Driver would be the nicest
code (after all then MySQL may someday remove that old
name), but functionally there will not be a difference.

Arne
Thomas Kellerer - 15 Dec 2007 19:04 GMT
Lew wrote on 15.12.2007 18:56:

>> madhura wrote on 15.12.2007 03:26:
>>> Hi,
[quoted text clipped - 9 lines]
> Madhura - take note that you're aiming for the wrong driver.  You want
> com.mysql.jdbc.Driver.

Which is well documented in the manual


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.