• 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

Hibernate over Jdbc

 
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi ranchers,

I guess this question might be asked before,but just want to know is there any compelling reason to prefer hibernate over jdbc other
than the following:

1. Database independent,the code works for Oracle,MySQL,SQlServer etc
2. No knowledge of SQL is needed.
3. No need for query tuning as hibernate has criteria queries
4. Support for cache

Other than the above, is there any other advantage to use hibernate over jdbc?


 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The other things that I can think of:
- You don't need to write tons of JDBC based boiler plate code.
- It's easy to model inheritance hierarchies in Hibernate. Therefore, you can have code with a more OO flavour to it. I have no experience in trying this in JDBC. But we used to have a persistence strategy that was based on JDBC and it basically had a flat structure (next to no use of inheritance). This then promotes procedural code....
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


3. No need for query tuning as hibernate has criteria queries


This is not true. Hibernate doesn't generate well tuned SQL. That can only be done manually, since so much of what makes SQL performant or otherwise is based on the data and its use as well as the model. Database applications need performance tuning, regardless of the data access technology used.
 
reply
    Bookmark Topic Watch Topic
  • New Topic