Books Related to Java Technology

Saturday, April 11, 2009

Advantage of Hibernate over JDBC

  1. Hibernate provides data base independent query mechanism but JDBC does not. You need to write database specific query.
  2. Hibernate treats tables as objects and so you can work with classes and objects instead of queries and result sets but its not so with jdbc.
  3. Hibernate provides its own powerful query language called HQL (Hibernate Query Language). Using HQL you can express queries in a familiar SQL like syntax. It selects the best way to execute the database operations. JDBC supports only native Structured Query Language (SQL) and you need to write the effective query to access database.
  4. Hibernate eliminates need for repetitive SQL.
  5. Hibernate provides API to handle all create-read-update-delete (CRUD) operations i.e. no SQL is required.
  6. Hibernate makes the development fast because it relieves you from manual handling of persistent data
  7. You don’t require query tuning because hibernate does it automatically using Criteria Queries. But you need to tune queries while using jdbc.
  8. Hibernate supports query caching for better performance.
  9. Hibernate provides connection pooling by just mentioning a few lines in configuration file. But you need to write connection pooling code in case of jdbc.
  10. XML file in hibernate lets you specify all configuration information and relations between tables, which increases the readability and allows changes more easily.
  11. Hibernate supports lazy loading. Objects can also be loaded on startup by turning off the lazy attribute. Jbdc does not support it.
  12. Hibernate supports Automatic Versioning and Time Stamping but jdbc does not.
For More Details You can visit to

No comments:

Post a Comment