Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the jdbc driver "org.gjt.mm.mysql.Driver" for?

Tags:

After taking over a coworker's project I noticed he was using "org.gjt.mm.mysql.Driver" as the jdbc driver for MySQL 5 instead of the more common one "com.mysql.jdbc.Driver". They both are contained in the driver I found on Maven central that appears to be the standard distribution of the driver.

When I look up gjt.org I found some old site that talks about "Mark's mysql driver".

http://gjt.org/

like image 660
benstpierre Avatar asked Apr 27 '11 17:04

benstpierre


People also ask

What is the JDBC driver for MySQL?

MySQL Connector/J is the official JDBC driver for MySQL. MySQL Connector/J 8.0 is compatible with all MySQL versions starting with MySQL 5.6.

What is the use of MySQL driver?

MySQL provides standards-based drivers for JDBC, ODBC, and . Net enabling developers to build database applications in their language of choice. In addition, a native C library allows developers to embed MySQL directly into their applications. These drivers are developed and maintained by the MySQL Community.

What is MySQL Connector Java used for?

MySQL provides connectivity for client applications developed in the Java programming language with MySQL Connector/J. Connector/J implements the Java Database Connectivity (JDBC) API, as well as a number of value-adding extensions of it. It also supports the new X DevAPI.

What drivers are needed for MySQL?

JDBC, ODBC, and . Net drivers are necessary for MySQL as they enable the developers for building their database applications.

Should I use GJT or JDBC for MySQL driver?

But you should still be using com.mysql.jdbc.Driver and not that org.gjt.mm.mysql.Driver. Also read the docs at the MySQL site. This discussion has been closed.

What is a JDBC driver?

JDBC drivers are Java library files with the extension .jar used by all Java applications to connect to the database. Usually, they are provided by the same company which implemented the MySql software.

How to connect to MySQL using JDBC?

1 url: the database URL in the form jdbc:subprotocol:subname. For MySQL, you use the jdbc:mysql://localhost:3306/mysqljdbc i.e., you are connecting to the MySQL with server name localhost, port 3006, and database mysqljdbc. 2 user: the database user that will be used to connect to MySQL. 3 password: the password of the database user.

What is the best way to get the latest MySQL Connector driver?

By the way, the mentioned driver class name is a very old driver. You shouldn't be using that anymore. Surf to the MySQL homepage and download the most recent Connector/J JDBC driver for your database version. Documentation is also available over there. i just got this driver, it's "mysql-connector-java-5.1.6"


1 Answers

The MySQL JDBC driver was initially developed by a hobbyist. It's later donated to MySQL where they renamed the package/classname. The old classname is kept for backwards compatibility reasons, but if you can, you should update it to com.mysql.jdbc.Driver as soon as possible.

like image 106
BalusC Avatar answered Oct 30 '22 13:10

BalusC