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
What is difference between odbc and jdbc?
What isolation level is used by the DBMS when inserting, updating and selecting rows from a database?
Under what circumstances, that all four drivers are used?
When does the result for an sql statement return null?
Why is odbc needed?
What is a merge field?
What is JDBC RowSet? What are different types of RowSet?
How many ways can you update a result set?
How many locking systems are there in jdbc?
What is encrypted connection?
What are common JDBC Exceptions?
What is the difference between executing, executequery, executeupdate in jdbc?
What are different types of ResultSet?
What is jdbc explain?
What is ODBC and JDBC? How do you connect the Database?