public class DefaultConnectionHolder extends Object implements ConnectionHolder
Modifier and Type | Field and Description |
---|---|
protected DataSource |
ds |
Constructor and Description |
---|
DefaultConnectionHolder(DataSource ds)
构造
|
Modifier and Type | Method and Description |
---|---|
void |
closeConnection(Connection conn)
关闭连接
自定义关闭连接有利于自定义回收连接机制,或者不关闭 |
Connection |
getConnection()
获得链接。
|
DataSource |
getDs()
获得数据源
|
protected final DataSource ds
public DefaultConnectionHolder(DataSource ds)
ds
- DataSource
public DataSource getDs()
public Connection getConnection() throws DbException
ConnectionHolder
getConnection
in interface ConnectionHolder
Connection
DbException
- 连接获取异常public void closeConnection(Connection conn)
ConnectionHolder
closeConnection
in interface ConnectionHolder
conn
- 连接 Connection
Copyright © 2025. All rights reserved.