Using the following:
protected void testDriver ( ) {
String drivers = "nada";
try {
Class.forName("com.mysql.jdbc.Driver").newInstance();
} catch ( java.lang.ClassNotFoundException e ) {
System.out.println("MySQL JDBC Driver not found ... ");
} catch (IllegalAccessException ex) {
System.out.println("Illegal Access");
} catch (InstantiationException ex) {
System.out.println("Instantiation problem");
}
System.out.println("Midway drivers are " + drivers);
try {
drivers = (String) java.security.AccessController.doPrivileged(
new sun.security.action.GetPropertyAction("jdbc.drivers"));
} catch (Exception ex) {
drivers = "balderdash";
}
System.out.println(drivers);
}
I get the output
"Midway drivers are nada"
"null"
This tells me that java.security.AccessController.doPrivileged isn't quite doing what I expected. Why isn't it picking up a driver? Is it the proper usage? How /do/ you load a mySQL driver, anyways?
Other than the printlns, this is about the same as the mySQL code I had seen other places.
Thanks,