This section contains information specific to programming with version 1.1h of the MM.MySQL JDBC driver.
Some virtual machines (notably Microsoft's and Netscape's) don't properly call some static class initializers.
This causes the driver registration to fail when using the Class.forName() method.
The work-around is to add the newInstance() call. To assure that their applications will run on all virtual machines, developers should always call newInstance() when registering a driver.
Example 1-1. Class Loader Work-Around
try { Class.forName("org.gjt.mm.mysql.Driver").newInstance(); } catch (Exception E) { E.printStackTrace(); } |