• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate Vs JDBC

 
kri shan
Ranch Hand
Posts: 1479
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have Orcale 9i database. Can i replace Hibernate instead of jdbc? How it affects the performance of the System?
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate will work fine with Oracle 9i (that's what my company uses).

Since Hibernate uses JDBC, with enough time, work, and craftiness you should be able to hand-code JDBC to be faster than Hibernate. The trick, however, is that with a sufficiently complex application, the risks of making a mistake with JDBC are greater than with a tool like Hibernate, JDO, TopLink, etc.

If your business logic modifies more than one object or different fields of the same object in different methods, optimizing JDBC becomes quite difficult and error prone. Hibernate helps out here by persisting object changes as a single unit, allowing some optimization (e.g. convert two updates to a user into a single SQL update).

I suggest reading some of the past messages in this forum to get a feel for the differences and whether or not Hibernate or a similar tool will be right for your application. There is no single answer.
 
Pj Murray
Ranch Hand
Posts: 194
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by David Harkness:
There is no single answer.


The fact that there's no "perfect" data persistence technology that can be recommended for all types of application means you need to be careful (and maybe flexible).

You may find "Choosing a data persistence strategy useful"

http://www.codefutures.com/weblog/andygrove/archives/2005/01/choosing_a_java.html


Also, a comparison of the various technologies

http://www.codefutures.com/weblog/corporate/archives/2005/02/data_persistenc.html

Finally, you need to separate out your choice of technologies (JDBC, Hibernate, EJB CMP, etc) from best design practices (such as using Data Access Objects).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic