posts - 37, comments - 9, trackbacks - 0, articles - 0

Hibernate In Action Note

Posted on 2005-09-05 22:14 飞翔 阅读(230) 评论(0)  编辑  收藏 所属分类: JavaDataBase
1.(Hibernate with a connection pool in a non-managed environment)
Using hibernate.properties for C3P0 connection pool settings:
hibernate.connection.driver_class = org.postgresql.Driver
hibernate.connection.url = jdbc:postgresql://localhost/auctiondb
hibernate.connection.username = auctionuser
hibernate.connection.password = secret
hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect
hibernate.c3p0.min_size=5
hibernate.c3p0.max_size=20
hibernate.c3p0.timeout=300
hibernate.c3p0.max_statements=50
hibernate.c3p0.idle_test_period=3000
2.(Hibernate in a managed environment with an application server)
hibernate.connection.datasource = java:/comp/env/jdbc/AuctionDB
hibernate.transaction.factory_class = \
net.sf.hibernate.transaction.JTATransactionFactory
hibernate.transaction.manager_lookup_class = \
net.sf.hibernate.transaction.JBossTransactionManagerLookup
hibernate.dialect = net.sf.hibernate.dialect.PostgreSQLDialect

结合spring 后就不是这样了,可以右spring 控制transaction & datasource &...

只有注册用户登录后才能发表评论。


网站导航: