Hi Friends.......
what we can't do in jdbc but can do hibernate?
Thanks........
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 14, 2011, 7:43 AM EST
Advantages of hibernate over jdbc
1) Hibernate is data base independent, The code will work for all kind of database like Derby, MySQL,ORACLE, PostGreSQL, SQLServer etc.
Where as in JDBC query must be database specific
2) As Hibernate is set of Objects , No need of SQL knowledge.
In JDBC you need SQL Knowledge is must.
3) In Hibernate, Criteria Query take care of Query Tuning. In case of JDBC you need to tune your queries.
4) As Hibernate Supports two level of cache, you can store data into catch for better performance while in JDBC you need to implement your java cache.
5) Hibernate supports Query cache and It will provide the statistics about your query and database status.
JDBC Not provides any statistics.
6) Development fast in case of Hibernate because you don?t need to write queries
7) No need to create any connection pool in case of Hibernate. You can use c3p0.
In case of JDBC you need to write your own connection pool
8) In the xml file you can see all the relations between tables in case of Hibernate. Easy readability.
9) You can load your objects on start up using lazy=false in case of Hibernate.
But JDBC Don't have such support.
10 ) Hibernate Supports automatic versioning of rows but JDBC Not.
Please refer the below link
http://www.java-samples.com/showtutorial.php?tutorialid=813
Thanks
Vikas MishraRank #559 · 4.3K reputationPosted Dec 14, 2011, 1:03 PM EST