• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

User credientials doubt

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
author & internet detective
Posts: 41919
910
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to confirm, hibernate.cfg.xml overides the properties in hibernate.properties file if both are present.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic