How to set up datasource with Spring for HikariCP?

后端 未结 9 877
傲寒
傲寒 2020-11-27 02:51

Hi I\'m trying to use HikariCP with Spring for connection pool. I\'m using jdbcTempLate and JdbcdaoSupport.
This is my spring configuration file for datasource:

9条回答
  •  攒了一身酷
    2020-11-27 03:29

    I found it in http://www.baeldung.com/hikaricp and it works.

    Your pom.xml

    
                com.zaxxer
                HikariCP
                2.6.3
            
    

    Your data.xml

    
        
        
        
        
    
    
        
    
    
    

    Your jdbc.properties

    jdbc.driverClassName=org.postgresql.Driver
    jdbc.dialect=org.hibernate.dialect.PostgreSQL94Dialect
    jdbc.databaseurl=jdbc:postgresql://localhost:5432/dev_db
    jdbc.username=dev
    jdbc.password=dev
    

提交回复
热议问题