wood burning stoves 2.0*
The moose likes Object Relational Mapping and the fly likes Jdbc vs Hibernate support Jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Jdbc vs Hibernate support Jdbc" Watch "Jdbc vs Hibernate support Jdbc" New topic
Author

Jdbc vs Hibernate support Jdbc

Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Hi Folks,

in hibernate we can get jdbc support through session.connection() [java.sql.Connection]example



here [know that it is poor practice since i am not going to deal with javabean] everything looks like ordinary jdbc intraction .

for doing this we dont go for hibernate instead we can get it through jdbc itself or Connection pooling.

is there any difference (Advantage)?
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Hibernate allows direct access to JDBC for the same reason it provides methods to run SQL directly: for the few cases where your specific application logic requires you do something with the database that cannot be done through Hibernate itself. For example, you might want to create database users in your application. The disadvantage is you tie your applciation into the specifics of one particular database.


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Thanks Paul
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Jdbc vs Hibernate support Jdbc
 
Similar Threads
When to use Hibernate?
Q 4 C. Bauer & G. King (11): database transactions
Can I do raw DML with Hibernate?
Weblogic 8.1 and JDBC
Hibernate, ResultSet and PrepareStatement