To use Hibernate-provided JDBC connections, the configuration file requires the following five properties:
connection.driver_class -The JDBC connection class for the specific database connection.url -The full JDBC URL to the database connection.username -The username used to connect to the database connection.password -The password used to authenticate the username dialect -The name of the SQL dialect for the database
like above, we can do like following.
case1: In weblogic admin console, we can give driver name,username ,password,and URL and etc.So here we are giving at admin console.
case2:we can give in hibernate.cfg.xml
case 3:we can also give in hiberante.properties.
what is the difference between these three?
If we give like case1 case 2 and case3,which one will be taken into consideration. which method will be searched first for identifying the those details.
Case one makes a datasource. It is not Hibernate specific. It is a J2EE Datasource.
Case Two and Three are Hibernate specific configurations, it can point to the DataSource from your App Server, or it can create its own connection pool, or configure it to use a third party connection pool like C3PO.
Either of the three ways. Hibernate requires some kind of Connection pool. If you have case 2 or 3 not point ot the datasource you created in case 1, then case 1 is not even in play. But I forget which of the two Hibernate files takes precedence the cfg over the .properties or the other way around.