c3p0中DataSource接口的实现类是ComboPooledDataSource,它是c3p0的核心类
void setDriverClass 设置连接数据库的驱动名称
void setJdbcUrl 设置连接数据库的路径
void setUser 设置数据库的登录账号
void setPassword 设置数据库的登录密码
void setMaxPoolSize 设置数据库连接池最大的连接数目
void setMinPoolSize 设置数据库连接池最小的连接数目
void setInitialPoolSize 设置数据库连接池初始化的连接数目
connection getConnection 从数据库连接池中获取一个连接
如果要使用配置文件 名字必须为c3p0-config.xml ,并位于该项目的src根目录下。
ComboPooledDataSource cs = new CombopooledDataSource();