Free Jobs

click here

click here
Hibernate Interview Questions(Basic)

For more advanced and tough Hibernate Interview Questions Click Here

Q1.What is Hibernate?
Hibernate is an open source project that provides an object-relational mapping solution for Java applications while completely abstracting the power of the underlying data source. Business logic uses objects to represent data and databases store relational data in a table format.Hibernate maps the data represented in Java objects to the relational data of the database. Hibernate also provides a persistence layer for saving, updating and retrieving data in database and connection pool,transaction management facilities.

Q2. What is JDBC?
JDBC stands for Java database connectivity (JDBC).It is the API that allows Java programs to access database management systems.

Q3. What is the advantage of Hibernate over JDBC?
a)Hiberante is loosely tied with the database so better Application portability to other database.But JDBC is tighlty tield with the database.
b)Persistence in hibernate can be achieved by configuration xml file.But in JDBC we need to change the code.
c)Hibernate provides automatic mapping of Java objects with database tables and vice versa while with JDBC we need to write code for that.

Q4. What are the two config files used for Hibernate?
The following two files
are used to configure the hibernate service.

Q5. Enumerate some common methods of Hibernate configuration?
The common methods of Hibernate configuration are:
a)Programmatic configuration
b)XML configuration

Q6. Name the Core interfaces of Hibernate?
Following are the core interfaces of Hibernate:
a)Session interface
b)SessionFactory interface
c)Configuration interface
d)Transaction interface
e)Query and Criteria interfaces

Q7. What is the use of Mapping files (*.hbm.xml) in Hibernate?
The mapping files Mapping files (*.hbm.xml) are used to map persistent objects to a relational database. Each persistent class should be stored in different mapping files.

Q8. What is an Hibernate session?
An Hibernate Session is a non-threadsafe object which represents a single unit of work with the application database.

Q9. What is the Transparent Persistence in Hibernate?
The automatic mapping of Java objects with database tables and vice versa is called Transparent Persistence. Hibernate provides transparent persistence.

Q10. How can we create java application which interacts with database using Hibernate?
Hibernate simplifies the creation database enabled application using Hibernate.First write the simple java object.The create the XML mapping file that shows relationship between database and class attributes. The Hibernate APIs can be used to store persistent objects.

For more advanced and tough Hibernate Interview Questions Click Here Copyright © 2009-2011 | All Rights Reserved
All content of this website is protected by copyright laws and should not be reproduced in any form or by any means without written permission
(Best viewed in IE 8.0+ or Firefox 3.0+ at resolution of 1024 * 768 or higher)