datasource.type=mysql
datasource.driverClassName=org.gjt.mm.mysql.Driver
datasource.url=jdbc:mysql://localhost/test?useUnicode=true&characterEncoding=utf-8
datasource.username=root
datasource.password=123456
datasource.maxActive=10
datasource.maxIdle=2
datasource.maxWait=120000
datasource.whenExhaustedAction=1
datasource.validationQuery=select 1 from dual
datasource.testOnBorrow=true
datasource.testOnReturn=false
c3p0.acquireIncrement=3
c3p0.initialPoolSize=3
c3p0.idleConnectionTestPeriod=900
c3p0.minPoolSize=2
c3p0.maxPoolSize=50
c3p0.maxStatements=100
c3p0.numHelperThreads=10
c3p0.maxIdleTime=600
hibernate.dialect=org.hibernate.dialect.MySQLDialect
hibernate.jdbc.batch_size=25
hibernate.jdbc.fetch_size=50
hibernate.show_sql=true
hibernate.query.factory_class=org.hibernate.hql.ast.ASTQueryTranslatorFactory
hibernate.cglib.use_reflection_optimizer=true
hibernate.connection.release_mode=after_transaction
usercache.config=oscache.properties
blogcache.config=blogoscache.properties
在spring配置文件中引用方式为:
例如:
class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
name="dataSource">
local="dataSource" />
name="hibernateProperties">
key="hibernate.cglib.use_reflection_optimizer">${hibernate.cglib.use_reflection_optimizer}
key="hibernate.query.factory_class">${hibernate.query.factory_class}
key="hibernate.dialect">${hibernate.dialect}
key="hibernate.show_sql">${hibernate.show_sql}
key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}
key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}
name="mappingDirectoryLocations">
classpath:/com/hbm/pojo