Difference between JDBC and Hibernate?
Give one sample based on the variance?

Answer Posted / mukundan

Hibernate is one level above JDBC in the sense that Hiberate
internally uses JDBC. Hence a direct comparison may not be
effecient. Still...

Hibernate is Object based mapping (ORM). JDBC concerns more
of RDB meta data mapped to the members of the java objects
i.e. POJO.

Data sent and results returned from RDB loaded back into
Domain (POJO) objects are taken care internally by
Hibernate. In JDBC loading the returned data from RDB into
java objects to be done externally, by developer.

Hibernate caches data at Level 1 and supports optional Level
2 caching through third party software (ehcache,
TreeCache/JBoss cache etc.) Caching is totally external to
JDBC.

Hibernate supports HQL which is again more Java Object
based. JDBC supports only SQL and relating and loading Java
objects should be done externally by developer.

Hibernate supports lazy loading of objects which JDBC
doesn't support.

RDB Table dependency and integrity in Hibernate is supported
through Object relationships. It is external to JDBC.

Through Object relationship (defined in XML) the entire RDB
DDL could be generated. This is out of scope in JDBC.

Is This Answer Correct ?    25 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which package is used for jdbc application?

519


What is drivermanager in jdbc?

544


Why is jdbc used?

524


Explain about the Try Block?

562


Which interface handles transaction management in jdbc?

572






Explain the difference between inner and outer join ?

516


What is an advantage of using the jdbc connection pool?

454


Explain about the drive manager class working?

608


How do I find whether a parameter exists in the request object?

499


What are the differences between setmaxrows(int) and setfetchsize(int)?

546


What is jdbc connection?

654


What are the different types of resultset?

550


Does jdbc require oracle client?

531


How can I retrieve a String or other object type without creating a new object each time?

583


What is the difference between jdbc and odbc?

530