Connection Pooling with Spring & Hibernate

后端 未结 5 1106
北海茫月
北海茫月 2021-02-09 00:14

How to configure connection pooling with Spring and Hibernate?

Thanks

Venu

5条回答
  •  Happy的楠姐
    2021-02-09 01:01

    If you want to use Best among all Java Connection Pool providers try HikariCP. Configure a datasource bean using HikariCP in servlet-context as:

    
                    
                    
                    
                    
                    
                              
                                  jdbc:mysql://localhost:3306/exampledb
                                  root
                                  
                                   250
                                   2048
                                   true
                                   true
                              
                    
    
    

    Then use this datasource to create EntityManagerFactory bean.

提交回复
热议问题