1 / 58
文档名称:

dbutils封装ORM 实现BaseDAO.doc

格式:doc   大小:19KB   页数:58页
下载后只包含 1 个 DOC 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

分享

预览

dbutils封装ORM 实现BaseDAO.doc

上传人:好用的文档 2021/10/5 文件大小:19 KB

下载得到文件列表

dbutils封装ORM 实现BaseDAO.doc

文档介绍

文档介绍: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