开发者

How to set up hibernate to use Glassfish connection pool?

开发者 https://www.devze.com 2022-12-24 17:38 出处:网络
I have set up a connection pool in Glassfish with a jndi resource for it also setup. I am stumped on how to configure hibernate to go g开发者_如何学运维et it.

I have set up a connection pool in Glassfish with a jndi resource for it also setup. I am stumped on how to configure hibernate to go g开发者_如何学运维et it.

I have come across alot of write ups to configure it to use C3P0 connection pool. Well I am lost. I found that I need to set:

hibernate.connection.datasource
hibernate.jndi.url 
hibernate.jndi.class 
hibernate.connection.username
hibernate.connection.password
  • Would datasource be the same as the hibernate.connection.datasource set in the connection pool?
  • What would hibernate.jndi.class be?
  • Are hibernate.connection.username and hibernate.connection.password for the connection to the database or to the appserver? I assume this is to the database, but why do I need them since that is all set in the appserver?


This article about hibernate basics seems to have the info you will want. Search for the string 'Using a JNDI DataSource'. Listing 2 is important. You may want to compare it against listing 1...

It looks like you can skip c3po, so many of your subquestions do not apply.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号