Bug #22661 Incompatibility of MySQL Connector/J with JDK 1.2.x
Submitted: 25 Sep 2006 10:40 Modified: 18 Oct 2006 10:32
Reporter: Siba Rath Email Updates:
Status: Closed Impact on me:
Category:Connector / J Severity:S2 (Serious)
Version:5.0.3 OS:Windows (win-XP)
Assigned to: CPU Architecture:Any

[25 Sep 2006 10:40] Siba Rath
We tried to connect to database in MySQL server 5.0 using a java class (1.2.2 JVM) and  MySQL Connector/J 5.0.3.

According to the documentation, "MySQL Connector/J supports Java-2 JVMs, including JDK-1.2.x, JDK-1.3.x, JDK-1.4.x and JDK-1.5.x, and requires JDK-1.4.x or newer to compile (but not run). MySQL Connector/J does not support JDK-1.1.x or JDK-1.0.x"

There was an exception: "java.lang.NoClassDefFoundError: java/util/Timer"
Exact stacktrace is as follows:
Exception in thread "main" java.lang.NoClassDefFoundError: java/util/Timer
        at com.mysql.jdbc.Connection.<init>(Compiled Code)
        at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java
        at java.sql.DriverManager.getConnection(Compiled Code)
        at java.sql.DriverManager.getConnection(DriverManager.java:152)

How to repeat:
Run the following java code in JDK 1.2.2 to get a connection from mySQL 5 db server.

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public class HelloWorld {

	private static final String JDBC_DRIVER_NAME = "com.mysql.jdbc.Driver";

	private static final String DB_URL = "jdbc:mysql://";

	 * @param args
	public static void main(String[] args) {
		Connection con = null;
		try {
			con = getConnection();

		} catch (SQLException e) {
		} catch (InstantiationException e) {
		} catch (IllegalAccessException e) {
		} catch (ClassNotFoundException e) {
		} finally {
			if (con != null) {
				try {
				} catch (SQLException e) {
				con = null;
		// while(rs.)

	private static Connection getConnection() throws SQLException,
			InstantiationException, IllegalAccessException,
			ClassNotFoundException {
		Connection con = null;
		con = DriverManager.getConnection(DB_URL);
		return con;

[25 Sep 2006 13:19] Mark Matthews
JDK-1.2.x went through Sun's end-of-life process quite awhile ago and is no longer supported by Sun. We can't always include support for non-supported, older JDKs in our newer drivers (otherwise the burden of working around missing functionality is too great). We don't test on JDK-1.2.x as well (only going back to 1.3.1, which goes EOL next month according to Sun).

I'll have the documentation team make a note of this in our manual. At this time your options are to stick with Connector/J 3.1.x (which supports all major MySQL-5.x features other than XA), or to upgrade your JDK.
[18 Oct 2006 10:32] MC Brown
The documentation for Connector/J has been updated with the JDK 1.2.x limitation and a compatibility note for 3.1.x and earlier.