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

How to set NULL values in JDBC PreparedStatement?

549


What is an encrypted internet connection?

505


DB2 Universal claims to support JDBC 2.0, But I can only get JDBC 1.0 functionality. What can I do?

596


How can I determine the isolation levels supported by my DBMS?

531


Why hibernate is better than jdbc?

510






How do we call a stored procedure from jdbc?

563


How can we maintain the integrity of a database by using jdbc?

544


What is the role of class.forname while loading drivers?

576


What does the jdbc resultsetmetadata interface?

563


Which jdbc driver is the fastest driver?

561


Is jdbc faster than odbc?

515


What is JDBC Driver interface?

586


What is an odbc driver?

495


What is jdbc odbc driver?

586


Is jdbc part of j2ee?

523