public interface ConnectionHolder
| 限定符和类型 | 方法和说明 |
|---|---|
default void |
cancelTransaction()
取消事务状态,设置为自动递交
|
Connection |
getConnection()
获取数据库连接
|
DataSource |
getDataSource()
获取数据库连接
|
int |
getRefCount() |
default boolean |
hasTransaction()
是否存在事务
|
boolean |
isOpen()
则表示当前数据库连接是否被打开(被打开的连接一定有引用)
|
void |
released()
减少引用计数,一个因为持有人已被释放
|
void |
requested()
增加引用计数,一个因为持有人已被请求
|
default void |
setTransaction()
设置事务状态
|
void requested()
void released()
throws SQLException
SQLExceptionint getRefCount()
Connection getConnection() throws SQLException
SQLExceptionDataSource getDataSource() throws SQLException
SQLExceptionboolean isOpen()
default boolean hasTransaction()
throws SQLException
SQLExceptiondefault void setTransaction()
throws SQLException
SQLExceptiondefault void cancelTransaction()
throws SQLException
SQLExceptionCopyright © 2021. All rights reserved.