2
我在Glassfish中建立了一个连接池,并为其安装了一个jndi资源。我难以理解如何配置hibernate来获取它。如何设置休眠以使用Glassfish连接池?
我遇到了很多写作配置它使用C3P0连接池。那么我迷路了。我发现我需要设置:
hibernate.connection.datasource
hibernate.jndi.url
hibernate.jndi.class
hibernate.connection.username
hibernate.connection.password
- 将数据源是相同的连接池
hibernate.connection.datasource
集? - hibernate.jndi.class会是什么?
- 连接数据库或应用程序服务器的hibernate.connection.username和hibernate.connection.password?我认为这是数据库,但为什么我需要它们,因为这些都是在appserver中设置的?
你见过? http://docs.jboss.org/hibernate/stable/core/reference/en/html/session-configuration.html#configuration-optional-jndi – Jeremy 2010-03-24 14:33:34
我其实已经去过那个页面,但没有那个部分。也许这只是一大早,但对我来说仍然有点神秘。感谢您的链接。 – 2010-03-24 14:48:24
@Jer这似乎是将SessionFactory作为JNDI资源来使用。这是一回事吗?基本上我只关心让Hibernate使用Glassfish连接池。 – 2010-03-24 16:15:30