Hiberate hibernate. cfg. xml and c3p0 connection pool configuration instances

Source: Internet
Author: User

 
 
 
 
  
   
   
    
Com. mysql. jdbc. Driver
   
   
   
    
Jdbc: mysql: // localhost/hibernate
   
   
   
    
Root
   
   
   
    
32147
   
   
   
    
20
   
   
   
    
1
   
   
   
    
5000
   
   
   
    
100
   
   
    
3000
   
   
    
2
   
   
    
True
   
   
   
    
Org. hibernate. dialect. MySQLInnoDBDialect
   
   
   
    
Update
   
   
   
    
True
   
   
   
    
True
   
   
   
  
 

First, hibernate. cfg. xml is generally placed in the src directory.

The self-built connection pool of Hiberate has only test value and is not recommended for actual projects. You can use the C3p0 or Proxool connection pool in the actual project. To use the c3p0 connection pool or proxool connection pool, you only need to configure the attributes in these connection pool configurations instead of hiberate. connection. pool_size.

The above example uses the c3p0 data source, so you also need to add the JAR package under the c3p0 directory of the optional subdirectory of hiberate-distribution-3.6.0.Final \ lib to the class loading path of the system.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.