File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 REST with Spring (video course) this week in the Spring forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Jdbc vs Hibernate support Jdbc" Watch "Jdbc vs Hibernate support Jdbc" New topic

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

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
I agree. Here's the link:
subject: Jdbc vs Hibernate support Jdbc
It's not a secret anymore!