1 <?XML version= "1.0" encoding= "UTF-8"?>2 <!DOCTYPE hibernate-configuration Public3 "-//hibernate/hibernate Configuration DTD 3.0//en"4 "Http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">5 <hibernate-configuration>6 7 <session-factory>8 < Propertyname= "Connection.url">Jdbc:oracle:thin:@127.0.0.1:1521:orcl</ Property>9 < Propertyname= "Connection.username">Username</ Property>Ten < Propertyname= "Connection.password">Password</ Property> One <!--database JDBC Driver class name - A < Propertyname= "Connection.driver_class">Oracle.jdbc.driver.OracleDriver</ Property> - <!--Database dialect - - < Propertyname= "dialect">Org.hibernate.dialect.Oracle10gDialect</ Property> the <!--DDL Statement Auto-Build table - - < Propertyname= "Hbm2ddl.auto">None</ Property> - < Propertyname= "Show_sql">True</ Property> - < Propertyname= "Format_sql">True</ Property> + - <!--Connection Pool Configuration - + < Propertyname= "Hibernate.connection.provider_class"> A Org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider at </ Property> - <!--the minimum number of JDBC connections in the connection pool. Hibernate defaults to 1 - - < Propertyname= "Hibernate.c3p0.min_size">5</ Property> - <!--the maximum number of JDBC connections in the connection pool. Hibernate defaults to - - < Propertyname= "Hibernate.c3p0.max_size">20</ Property> - <!--When an idle connection (in seconds) is removed from the connection pool. Hibernate defaults to 0 and never expires - in < Propertyname= "Hibernate.c3p0.timeout">300</ Property> - <!--the number of pre-compiled statements that are cached. Used to improve performance. Hibernate defaults to 0 and cache is not available - to < Propertyname= "Hibernate.c3p0.max_statements">100</ Property> + <!--the idle time (in seconds) before a connection is automatically validated. Hibernate defaults to 0 - - < Propertyname= "Hibernate.c3p0.idle_test_period">3000</ Property> the * <!--Registering an ORM mapping file - $ <Mappingclass= "com ..." />Panax Notoginseng - </session-factory> the </hibernate-configuration>
Hibernate4 configuration file Hibernate.cfg.xml configuration detailed