文档介绍:dbutils封装ORM 实现BaseDAO
;import .*;import .*;
import .*;
import ;
import ;
import ;
import ;/**
* 数据库管理
*
* */
***@SuppressWarnings("unchecked")
public class Configurations { private final static Log logger = ();
private final static ThreadLocal<Connection> conns = new ThreadLocal<Connection>();
private static DataSource dataSource;
private static boolean show_sql = true;
private static BasicDataSource dbcpDataSource = null;
private static ResourceBundle res = null;
static {
initDataSource(null);
} /**
* 初始化连接池
*
* ***@param props
* ***@param show_sql
*/
private final static void initDataSource(Properties dbProperties) {
try {
// 配置dbcp数据源 if (dbcpDataSource == null) {
dbcpDataSource = new BasicDataSource();
res = ("oracleConfig");
}
String driverClassName = ("driverClassName");
int initialSize = (("initialSize"));
int maxActive = (("maxActive"));
int maxIdle = (("maxIdle"));
int minIdle = (("minIdle"));
int maxWait = (("maxWait"));
Boolean logAbandoned = (res
.getString("logAbandoned"));
Boolean removeAbandoned = (res
.getString("removeAbandoned"));
int removeAbandonedTimeout = (res
.getString("removeAbandonedTimeout"));
Boolean testWhileIdle = (res
.getString("testWhileIdle"));
Boolean testOnBorrow = (res
.getString("testOnBorrow"));
Boolean testOnReturn = (res
.getStr