| Propery name | Purpose |
|---|
| hibernate.connection.datasource | datasource JNDI name | | hibernate.jndi.url | URL of the JNDI provider (optional)
| | hibernate.jndi.class | class of the JNDI InitialContextFactory (optional)
| | hibernate.connection.username | database user (optional)
| | hibernate.connection.password | database user password (optional)
|
Here's an example hibernate.properties file for an
application server provided JNDI datasource:
hibernate.connection.datasource = java:/comp/env/jdbc/test hibernate.transaction.factory_class = \ org.hibernate.transaction.JTATransactionFactory hibernate.transaction.manager_lookup_class = \ org.hibernate.transaction.JBossTransactionManagerLookup hibernate.dialect = org.hibernate.dialect.PostgreSQLDialect
JDBC connections obtained from a JNDI datasource will automatically participate
in the container-managed transactions of the application server.
Arbitrary connection properties may be given by prepending
"hibernate.connnection" to the property name. For example, you
may specify a charSet using hibernate.connection.charSet.
You may define your own plugin strategy for obtaining JDBC connections by implementing the
interface org.hibernate.connection.ConnectionProvider. You may select
a custom implementation by setting hibernate.connection.provider_class.
|