<dependency>
<groupId>com.mchange</groupId>
<artifactId>c3p0</artifactId>
<version>0.9.5.2</version>
</dependency>
ComboPooledDataSource dataSource = new ComboPooledDataSource();
{
try {
dataSource.setDriverClass("org.postgresql.Driver");
dataSource.setJdbcUrl("jdbc:postgresql://localhost/esxblog");
dataSource.setUser("postgres");
dataSource.setPassword("postgres");
} catch (PropertyVetoException e) {
e.printStackTrace();
}
}
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>1.1.16</version>
</dependency>
DruidDataSource dataSource = new DruidDataSource();
{
dataSource.setUrl("jdbc:mysql://localhost:3306/test");
dataSource.setUsername("root");
dataSource.setPassword("root");
}