• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

User credientials doubt

 
Sudhakar Reddy Kurakula
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please study this question carefully.

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.



cheers
Sudhakar

 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35279
384
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to move this to our Object/Relational Mapping forum for you where people know more about Hibernate.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

Mark
 
Lakshmi Dasari
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just to confirm, hibernate.cfg.xml overides the properties in hibernate.properties file if both are present.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic