remove connection pooling

This commit is contained in:
Thai Nguyen 2016-03-31 20:02:10 +07:00
parent 697c349f29
commit c1566e5851
2 changed files with 5 additions and 14 deletions

View File

@ -8,7 +8,6 @@
<properties>
<org.jooq.version>3.7.3</org.jooq.version>
<com.h2database.version>1.4.191</com.h2database.version>
<com.zaxxer.HikariCP.version>2.4.4</com.zaxxer.HikariCP.version>
<org.springframework.version>4.2.5.RELEASE</org.springframework.version>
<org.slf4j.version>1.7.18</org.slf4j.version>
<ch.qos.logback.version>1.1.3</ch.qos.logback.version>
@ -29,11 +28,6 @@
<artifactId>h2</artifactId>
<version>${com.h2database.version}</version>
</dependency>
<dependency>
<groupId>com.zaxxer</groupId>
<artifactId>HikariCP</artifactId>
<version>${com.zaxxer.HikariCP.version}</version>
</dependency>
<!-- Spring -->
<dependency>

View File

@ -1,14 +1,12 @@
package com.baeldung.jooq.introduction;
import javax.sql.DataSource;
import com.zaxxer.hikari.HikariDataSource;
import org.h2.jdbcx.JdbcDataSource;
import org.jooq.SQLDialect;
import org.jooq.impl.DataSourceConnectionProvider;
import org.jooq.impl.DefaultConfiguration;
import org.jooq.impl.DefaultDSLContext;
import org.jooq.impl.DefaultExecuteListenerProvider;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
@ -29,11 +27,10 @@ public class PersistenceContext {
@Bean
public DataSource dataSource() {
HikariDataSource dataSource = new HikariDataSource();
JdbcDataSource dataSource = new JdbcDataSource();
dataSource.setDriverClassName(environment.getRequiredProperty("db.driver"));
dataSource.setJdbcUrl(environment.getRequiredProperty("db.url"));
dataSource.setUsername(environment.getRequiredProperty("db.username"));
dataSource.setUrl(environment.getRequiredProperty("db.url"));
dataSource.setUser(environment.getRequiredProperty("db.username"));
dataSource.setPassword(environment.getRequiredProperty("db.password"));
return dataSource;