db2 jdbc 连接池_使用jdbc-pool替代dbcp、c3p0等连接池的原因

Support for highly concurrent environments and multi core/cpu systems.

Dynamic implementation of interface, will support java.sql and javax.sql

interfaces for your runtime environment (as long as your JDBC driver does the

same), even when compiled with a lower version of the JDK.

Validation intervals - we don't have to validate every single time we use

the connection, we can do this when we borrow or return the connection, just not

more frequent than an interval we can configure.

Run-Once query, a configurable query that will be run only once, when the

connection to the database is established. Very useful to setup session

settings, that you want to exist during the entire time the connection is

established.

Ability to configure custom interceptors. This allows you to write custom

interceptors to enhance the functionality. You can use interceptors to gather

query stats, cache session states, reconnect the connection upon failures, retry

queries, cache query results, and so on. Your options are endless and the

interceptors are dynamic, not tied to a JDK version of a java.sql/javax.sql

interface.

High performance - we will show some differences in performance later on

Extremely simple, due to the very simplified implementation, the line count

and source file count are very low, compare with c3p0 that has over 200 source

files(last time we checked), Tomcat jdbc has a core of 8 files, the connection

pool itself is about half that. As bugs may occur, they will be faster to track

down, and easier to fix. Complexity reduction has been a focus from inception.

Asynchronous connection retrieval - you can queue your request for a

connection and receive a Future back.

Better idle connection handling. Instead of closing connections directly, it

can still pool connections and sizes the idle pool with a smarter algorithm.

You can decide at what moment connections are considered abandoned, is it

when the pool is full, or directly at a timeout by specifying a pool usage

threshold.

The abandon connection timer will reset upon a statement/query activity.

Allowing a connections that is in use for a long time to not timeout. This is

achieved using the ResetAbandonedTimer

Close connections after they have been connected for a certain time. Age

based close upon return to the pool.

Get JMX notifications and log entries when connections are suspected for

being abandoned. This is similar to the removeAbandonedTimeout but

it doesn't take any action, only reports the information. This is achieved using

the suspectTimeout attribute.

Connections can be retrieved from a java.sql.Driver,

javax.sql.DataSource or javax.sql.XADataSource This is

achieved using the dataSource and dataSourceJNDI

attributes.

XA connection support

然后

com.ibm.db2.jcc.DB2Driver

jdbc:db2://localhost:50000/POCFI

ecif

ecif

3

12

3

3

SELECT 1 FROM SYSIBM.SYSDUMMY1

true

true

true

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值