Re: How to connect to a remote MySQL database using Java



Lew wrote:
Thomas Kellerer wrote:
madhura wrote on 15.12.2007 03:26:
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

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


.



Relevant Pages

  • Re: MAINFRAME SHOP STANDARDS
    ... > Pete Dashwood wrote: ... XP Pro is a good operating system. ... I'd have to check with M/F but assuming 'MySql' can be added ... itself as a driver and appears under your ODBC32 drivers when you create a ...
    (comp.lang.cobol)
  • Re: mySQL Connection String
    ... >>I use mySQL but can connect. ... >You say you can't connect to a MySQL database using the ODBC driver ... ODBC Driver for MySQL ...
    (microsoft.public.inetserver.asp.db)
  • Re: MySQL JDBC driver - implications for non-GPLed apps
    ... >> driver a particular user wants to implement. ... MySQL AB does not purport to be our ... > care to provide a clear-cut explanation as part of their license agreement. ... >> However then you look at it, is the value of the driver and database ...
    (comp.lang.java.databases)
  • Re: MySQL JDBC driver - implications for non-GPLed apps
    ... > If the reasoning of McKoi is valid, then it should be valid for MySQL ... I do not know if the reasoning provided by McKoi's developers is applicable ... > driver, but don't include the driver in your distribution, there is no ...
    (comp.lang.java.databases)
  • Re: JDBC replaces characters with question marks
    ... I am using MySql and the MySql connector J driver. ... > the characters have been replaced by the time the SQL statement makes it to ...
    (comp.lang.java.databases)