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

Answers were Sorted based on User's Feedback



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

Answer / mkj

1. hibernate is ORM wich maps POJO using xml
file to access and create data form hatro database.
but in jdbc developers has to write code to map
object model data to rdbms and it access.

2. jdbc using SQL to access database developer has to
effective way to access the database.but hibernate
provides HQL wich powerful and includes all feature
of SQL and supports ploymorphic query.
3. Hibernate data transaction is fast due to work is
perform due container mean its xml file mostly but
JDBC has slow transaction.

Is This Answer Correct ?    45 Yes 10 No

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

Answer / 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

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

Answer / kalyan

JDBC stands for Java Database Connectivity allows
developers to connect, query and update a database using
the Structured Query Language. JDBC API standard provides
Java developers to interact with different RDBMS and access
table data through Java application without learning RDBMS
details and using Database Specific JDBC Drivers.

Hibernate is an Object-Relational Mapping (ORM) solution
for JAVA. It is a powerful, high performance
object/relational persistence and query service. It allows
us to develop persistent classes following object-oriented
idiom – including association, inheritance and polymorphism.

Is This Answer Correct ?    6 Yes 1 No

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

Answer / sugunakarareddy

Hibernate is object relational mapping. which maps the pojos
using xml fiels. to access and create data from hetro
database. in jdbc we will a code for mapping to object model
data to relational database. access data.

jdbc support to sql only but in hibernate have hql is there.
all sql features are support to hql. but hql support
polymohisam query.

hibernate transaction performance is very fast compare jdbc
transcation.

Is This Answer Correct ?    6 Yes 1 No

Post New Answer

More JDBC Interview Questions

What are clob and blob data types in jdbc?

0 Answers  


How do I insert/update records with some of the columns having NULL value?

0 Answers  


Why resultset is used in java?

0 Answers  


Why prepared statements are faster?

0 Answers  


What is the function of setautocommit?

0 Answers  






How a driver can be loaded?

1 Answers  


What is the meaning of batch updates?

0 Answers  


Why do we need jdbc?

0 Answers  


what is call level interface?

1 Answers  


MY code is: public class P1{ public static void main(String ar[]) { class.forName("java.lang.String"); } } errors i got are :New.java:5: error: <identifier> expected class.forName("java.lang.String"); ^ New.java:5: error: invalid method declaration; return type required class.forName("java.lang.String"); ^ New.java:5: error: illegal start of type class.forName("java.lang.String"); ^ New.java:7: error: reached end of file while parsing } ^ 4 errors HELP ME>......

3 Answers  


Which database is used for java?

0 Answers  


password, is stored in as plain text. What can I do to protect my passwords?

0 Answers  


Categories