mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improve mapping support
This commit is contained in:
@@ -29,6 +29,7 @@ import java.sql.SQLException;
|
||||
import java.sql.Statement;
|
||||
import java.sql.Types;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Enumeration;
|
||||
import java.util.LinkedHashMap;
|
||||
import java.util.List;
|
||||
@@ -497,7 +498,7 @@ public final class JdbcUtils {
|
||||
} catch (ClassNotFoundException e) {
|
||||
// skip
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
return (Driver) Thread.currentThread().getContextClassLoader().loadClass(driverClassName).newInstance();
|
||||
} catch (IllegalAccessException e) {
|
||||
@@ -536,6 +537,10 @@ public final class JdbcUtils {
|
||||
return updateCount;
|
||||
}
|
||||
|
||||
public static void execute(DataSource dataSource, String sql, Object... parameters) throws SQLException {
|
||||
execute(dataSource, sql, Arrays.asList(parameters));
|
||||
}
|
||||
|
||||
public static void execute(DataSource dataSource, String sql, List<Object> parameters) throws SQLException {
|
||||
Connection conn = null;
|
||||
try {
|
||||
@@ -610,7 +615,7 @@ public final class JdbcUtils {
|
||||
stmt.setObject(i + 1, parameters.get(i));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Class<?> loadDriverClass(String className) {
|
||||
Class<?> clazz = null;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user