Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Properties;
import java.util.logging.Logger;
import javax.sql.DataSource;
import org.seasar.doma.gradle.codegen.exception.CodeGenException;
import org.seasar.doma.gradle.codegen.message.Message;

public class SimpleDataSource implements DataSource {
Expand All @@ -32,11 +31,6 @@ public Driver getDriver() {

public void setDriver(Driver driver) {
this.driver = driver;
try {
DriverManager.registerDriver(driver);
} catch (SQLException e) {
throw new CodeGenException(Message.DOMAGEN9001, e, e);
}
}

public String getUrl() {
Expand Down Expand Up @@ -108,6 +102,9 @@ protected Connection getConnectionInternal(Properties info) throws SQLException
throw new SQLException(Message.DOMAGEN5002.getMessage());
}
try {
if (driver != null) {
return driver.connect(url, info);
}
return DriverManager.getConnection(url, info);
} catch (SQLException e) {
if (UNABLE_TO_ESTABLISH_CONNECTION.equals(e.getSQLState())) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public static Class<?> forName(String className, String propertyName) {
public static Class<?> forName(String className, String propertyName, ClassLoader classLoader) {
AssertionUtil.assertNotNull(className, propertyName, classLoader);
try {
return classLoader.loadClass(className);
return Class.forName(className, true, classLoader);
} catch (ClassNotFoundException e) {
throw new CodeGenException(Message.DOMAGEN0033, propertyName, className, e);
}
Expand Down