dbconnectionpool.java
来自「本书由浅入深、循序渐进地介绍了MVC的体系结构和如何构建一个基于MVC的Web框」· Java 代码 · 共 41 行
JAVA
41 行
package com.gd.jdbc;
import java.sql.Connection;
import java.sql.SQLException;
public interface DbConnectionPool {
/**
* 设定连接池中存放连接的数目
* @param numConnections
*/
public void setMaxConns(int numConnections);
/**
* 设定打开或者关闭连接池
* @param onOrOff
* @throws Exception
*/
public void setConnWitch(String onOrOff) throws Exception;
/**
* 产生连接池
* @throws SQLException
*/
public void initConnPool() throws SQLException;
/**
* 从连接池中获取连接
* @return
* @throws SQLException
*/
public Connection getConnection() throws SQLException;
/**
* 将连接返回给连接池
* @throws SQLException
*/
public void returnConnection() throws SQLException;
/**
* 销毁连接池
* @throws SQLException
*/
public void destroyConnPool() throws SQLException;
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?