📄 myconnection.java
字号:
package Pool;
import java.sql.Connection;
import java.sql.SQLException;
public class MyConnection extends ConnectionCoat implements Connection
{
private Pool connPool;
private PoolConnection pconn;
public MyConnection(Pool pool, PoolConnection pconn)
{
super(pconn.getJdbcConnection());
this.pconn=pconn;
connPool = pool;
}
/**
*
* 覆盖close方法,将数据库连接返回连接池,而不是直接关闭连接
*
*/
public void close() throws SQLException
{
connPool.releaseConnection(this.pconn);
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -