We can't use DriverManager if we want to use custom driver classes.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1828 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -220,9 +220,10 @@ public class StaticConnectionProvider implements ConnectionProvider
|
||||
String driver, String url, String username, String password)
|
||||
throws PersistenceException
|
||||
{
|
||||
// load up the driver class
|
||||
// create an instance of the driver
|
||||
Driver jdriver;
|
||||
try {
|
||||
Class.forName(driver);
|
||||
jdriver = (Driver)Class.forName(driver).newInstance();
|
||||
} catch (Exception e) {
|
||||
String err = "Error loading driver [class=" + driver + "].";
|
||||
throw new PersistenceException(err, e);
|
||||
@@ -230,7 +231,10 @@ public class StaticConnectionProvider implements ConnectionProvider
|
||||
|
||||
// create the connection
|
||||
try {
|
||||
return DriverManager.getConnection(url, username, password);
|
||||
Properties props = new Properties();
|
||||
props.put("user", username);
|
||||
props.put("password", password);
|
||||
return jdriver.connect(url, props);
|
||||
} catch (SQLException sqe) {
|
||||
String err = "Error creating database connection " +
|
||||
"[driver=" + driver + ", url=" + url +
|
||||
|
||||
Reference in New Issue
Block a user