项目地址:http://www.snapbug.net/product/snappool/product_sp_01.htm Snap-ConnectionPool自称可以让几十、几百个Statement只占用同一个物理连接; 封装 对资源的申请、释放、回收、共享和同步 操作,为应用提供简单的,甚至是不改变应用风的调用接口。 1
项目地址:http://www.snapbug.net/product/snappool/product_sp_01.htm
Snap-ConnectionPool自称可以让几十、几百个Statement只占用同一个物理连接;封装对资源的申请、释放、回收、共享和同步操作,为应用提供简单的,甚至是不改变应用风格的调用接口。
1、配置文件DatabasePool.conf放在classes根目录下。
2、
ConnectionPool cp = ConnectionManager.getConnectionPool("数据源名"); //取得数据库连接
PreparedStatement pstmt = cp.prepareStatement("SQL语句"); //从数据库连接得到Statement
以下同一般SQL操作
用完后只需关闭Statement,只在整个项目结束时才关闭ConnectionPool
项目地址有详细帮助文件。
注意:
项目地址的下载页面有配置文件范例,但是范例中的配置文件DatabasePool.conf里的MySQL部分的driverClass项目是不妥的,他用的是org.gjt.mm.mysql.Driver,虽然也能用,但在使用远程数据库时会出错,改成com.mysql.jdbc.Driver就正常了。
Database three paradigms
How to delete a database
How to connect to the database in vb
MySQL restore database
How to distinguish whether two addresses are on the same site?
How to connect to access database in vb
How to solve the problem of invalid database object name
How to connect vb to access database