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/
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.
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.
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.
JDBC, ODBC, and . Net drivers are necessary for MySQL as they enable the developers for building their database applications.
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.
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.
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.
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"
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With