2.7 Using the JDBC Driver with MySQL

With MySQL installation of this NetWare release, the latest JDBC driver is copied to sys:\java\lib\ext and sys:\mysql\java on the NetWare server.

After the upgrade, make sure that only one version of MySQL JDBC connector file is available in sys:\java\lib\ext. All the older versions of this file must be deleted.

To connect to MySQL using JDBC driver, you need to grant the appropriate rights to the user in order to communicate with your MySQL database. For more information, see MySQL Java* Connectivity (JDBC) .

The driver com.mysql.jdbc must be loaded using the Class.forName() method. The default port is 3306 and the default database name is the same as the username you use to connect to MySQL. Use the following syntax:


jdbc:mysql://hostname:port/dbname?param1=value1&param2=value2

An example connection would look like this:


Class.forName("com.mysql.jdbc");
java.sql.Connection conn;
conn = DriverManager.getConnection("jdbc:mysql://<hostname>:
<port>//<database>", "user", "password");

For JDBC tutorials, see the Sun Java Learning Center.

Also, refer to the JDBC driver readme in the driver's ZIP file located at sys:\mysql\java.