1,定义连接池接口
import java.sql.*;
public interface ConnectionPool{
/** 从连接池中取出连接 */
public Connection getConnection()throws SQLException;
/** 把连接返回连接池 */
public void releaseConnection(Connection con)throws SQLException;
/** 关闭连接池*/
public void close();
}
2,定义连接池的实现
public interface ConnectionPool{
/** 从连接池中取出连接 */
public Connection getConnection()throws SQLException;
/** 把连接返回连接池 */
public void releaseConnection(Connection con)throws SQLException;
/** 关闭连接池*/
public void close();
}
浙公网安备 33010602011771号