An additional to your own answer (This should be a comment, but strangely in some questions I am unable to comment (I am a new user)).
You make DriverManager.registerDriver (Driver driver) redundant. What was happening is that your application's DriverManager was not being notified to register the driver. See the static startup section of the com.mysql.jdbc.Driver class:
//
// Register ourselves with the DriverManager
//
static {
try {
java.sql.DriverManager.registerDriver(new Driver());
} catch (SQLException E) {
throw new RuntimeException("Can't register driver!");
}
}
Not that this is important, but it's the way JDBC Drivers work (they only need to be triggered once to be automatically registered). To avoid a strong direct coupling of your class with the driver, choose to do
Class.forName("com.mysql.jdbc.Driver");
Usually on an application server, this code snippet is not required.