• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JDBC and Hibernate

 
Jim Patrick
Ranch Hand
Posts: 42
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am new to hibernate. Can someone please shed light on some of my doubts?

1) what is the difference between developing a web application using Hibernate and without using Hibernate?

2) I want to know how we can integrate Hibernate into a web application..

3) Is there any need of JDBC if we use Hibernate?

Rgds,
Jim
[ July 23, 2006: Message edited by: Jim Patrick ]
 
Scott Johnson
Ranch Hand
Posts: 518
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) what is the difference between developing a web application using Hibernate and without using Hibernate?


Hibernate provides an object oriented way to retrieve and persist data to a relational database. It automatically creates and executes sqls, populates beans using data retrieved from the database and persists data from beans to the database. Developer productivity is improved because they need to write less code. Performance is improved because of Hibernate's two layers of cache. The portability of your code increases because Hibernate automatically handles any database specific syntax.

A drawback is that mappings must be created between the beans and tables, but this is mitigated by tools such as Middlegen that can generate the mappings given the table schemas. There are also tools that can generate the mappings from beans.

2) I want to know how we can integrate Hibernate into a web application..


You build your application as you would with JDBC, except your Data Access Objects (DAOs) use the Hibernate API to retrieve/persist data instead of using the JDBC API.

3) Is there any need of JDBC if we use Hibernate?


Yes, Hibernate uses JDBC to communicate with the database.

Complete the Hibernate Tutorial for a crash course on how to use Hibernate.
[ July 23, 2006: Message edited by: Scott Johnson ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic