|
|
@ -1,5 +1,6 @@ |
|
|
|
package org.panda.jdbc; |
|
|
|
package org.panda.jdbc; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.sun.xml.internal.bind.v2.TODO; |
|
|
|
import org.panda.code.uitl.PropsUtil; |
|
|
|
import org.panda.code.uitl.PropsUtil; |
|
|
|
import org.panda.code.uitl.StringUtil; |
|
|
|
import org.panda.code.uitl.StringUtil; |
|
|
|
import org.panda.jdbc.helper.DbConfigInterface; |
|
|
|
import org.panda.jdbc.helper.DbConfigInterface; |
|
|
@ -21,7 +22,9 @@ public class JdbcUtils { |
|
|
|
* 线程安全 |
|
|
|
* 线程安全 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
private static final ThreadLocal<Connection> CONNECTION_HOLDER = new ThreadLocal<>(); |
|
|
|
private static final ThreadLocal<Connection> CONNECTION_HOLDER = new ThreadLocal<>(); |
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* 数据源 |
|
|
|
|
|
|
|
*/ |
|
|
|
private DataSource dataSource; |
|
|
|
private DataSource dataSource; |
|
|
|
|
|
|
|
|
|
|
|
public JdbcUtils(DataSource dataSource){ |
|
|
|
public JdbcUtils(DataSource dataSource){ |
|
|
@ -143,7 +146,6 @@ public class JdbcUtils { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 创建表 |
|
|
|
* 创建表 |
|
|
|
* |
|
|
|
|
|
|
|
* @param sql |
|
|
|
* @param sql |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void createTable(String sql) { |
|
|
|
public void createTable(String sql) { |
|
|
@ -169,7 +171,6 @@ public class JdbcUtils { |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 查询 |
|
|
|
* 查询 |
|
|
|
* |
|
|
|
|
|
|
|
* @param sql |
|
|
|
* @param sql |
|
|
|
* @param params |
|
|
|
* @param params |
|
|
|
* @param rsh |
|
|
|
* @param rsh |
|
|
@ -201,7 +202,6 @@ public class JdbcUtils { |
|
|
|
* @param st |
|
|
|
* @param st |
|
|
|
* @param rs |
|
|
|
* @param rs |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
|
|
public void release(Connection conn, Statement st, ResultSet rs) { |
|
|
|
public void release(Connection conn, Statement st, ResultSet rs) { |
|
|
|
if (rs != null) { |
|
|
|
if (rs != null) { |
|
|
|
try { |
|
|
|
try { |
|
|
|