mixpplus
11/18/2019 - 7:07 AM

c3p0utils

public class C3P0Utils {

    private static ComboPooledDataSource ds = new ComboPooledDataSource();

    // 1 获取连接
    public static Connection getConnection() throws SQLException {
        return ds.getConnection();
    }
    // 2 获取连接池 将来给jdbc工具类用: 如 dbutils
    public static DataSource getDataSource() {
        return ds;
    }
}