aspose file tools*
The moose likes Object Relational Mapping and the fly likes JDBC OR HIBERNATE ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JDBC OR HIBERNATE ?" Watch "JDBC OR HIBERNATE ?" New topic
Author

JDBC OR HIBERNATE ?

sameer khazi
Greenhorn

Joined: Sep 05, 2008
Posts: 28
Hi there...

As far as i know that JDBC is a API for working out Java Application with any database at hand.

And Hibernate is a ORM solution.

Please clarify the following questions:
1)How JDBC and Hibernate are related ?

2)Should i learn JDBC first and work on java applications.Then move to Hibernate.

I am having basic knowledge of Oracle SQL 9i. I asked a friend of mine as should i also learn PL/SQL, to which he replied "no need since now Hibernate takes care of all that"

There is an air of confusion over me.

what the impression i have is that- i must first learn JDBC and work on Java applications using it (this includes learning SQL, AND PL/SQL.

Then move to learn Hibernate.


My request is to please explain in bit detail.

Thank you ..eagerly waiting for the reply


tapeshwar sharma
Ranch Hand

Joined: Mar 10, 2006
Posts: 245

1)How JDBC and Hibernate are related ?

Internally, Hibernate uses JDBC.
Whatever ORM(Hibernate,iBatis etc.) one uses, JDBC provides the most basic layer of abstraction to the database


2)Should i learn JDBC first and work on java applications.Then move to Hibernate.

I would strongly suggest so.
However, this is my personal opinion.
Other people may tell you different.
sameer khazi
Greenhorn

Joined: Sep 05, 2008
Posts: 28
Hi Prashanth,

Thank for your suggestions.Also i would like to know from you or any member of the JavaRanch as which book should i go through which covers all the concepts of JDBC and working with Java Applications using particularly Oracle Database.

Thank you...
Mark Spritzler
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

OK, you get to hear my motto.

"Friends don't let friends write straight JDBC code"

With that it mind, if you ever do code JDBC, use something like Spring's SimpleJdbcTemplate to hide all that boilerplate/copy/paste, resource management, and Exception handling from your code.

It probably would be good to learn that JDBC code to see how much a pain it really is.

I suggest finding a tutorial online through a Google search for JDBC.

For Hibernate I can recommend "Java Persistence with Hibernate" from Manning press as the book that covers everything about Hibernate. For learning from scratch I can recommend "Hibernate Made Easily" from Cameron too.

Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
tapeshwar sharma
Ranch Hand

Joined: Mar 10, 2006
Posts: 245

It probably would be good to learn that JDBC code to see how much a pain it really is.


That, and the fact that while today everybody is "Spring-Happy", tomorrow some other framework may come that's even more popular...who knows?
If your basics are in place, it will take less effort to switch to the new one.
Jimmy Clark
Ranch Hand

Joined: Apr 16, 2008
Posts: 2187
Database Programming with JDBC and Java
by George Reese

O'REILLY
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968

This 72 post thread (and counting) is a good place to go when wondering about the benefits of JDBC or Hibernate or any ORM framework:

Why do we need a framework for ORM or JDBC programming?

-Cameron McKenzie
tapeshwar sharma
Ranch Hand

Joined: Mar 10, 2006
Posts: 245

This 72 post thread (and counting) is a good place to go when wondering about the benefits of JDBC or Hibernate or any ORM framework


I am afraid that's not what the OP's asking.

2)Should i learn JDBC first and work on java applications.Then move to Hibernate.

My answer is Yes.
The thread you are referring to may be beneficial for those who have knowledge of both JDBC and ORM and then deliberating upon which one to choose.
If you think there is a good reason to start with ORM directly then kindly shed some light.
sameer khazi
Greenhorn

Joined: Sep 05, 2008
Posts: 28
Hi there..

Well i do agree with the point Mr Prashanth has made out in his reply.
For me for the moment working Java Applications with the Oracle 9i/x database is important.

I want to have a firm hand on this since i have not yet gone in detail in this domain except having a basic knowledge of Oracle SQL 9i.

Then if once i finish this section i will be able to understand the upper layers like Hibernate and so on...

Please correct me in case i am wrong in my steps to be followed.

Thank you all , eagerly waiting.



sameer khazi
Greenhorn

Joined: Sep 05, 2008
Posts: 28
Originally posted by Cameron Wallace McKenzie:
This 72 post thread (and counting) is a good place to go when wondering about the benefits of JDBC or Hibernate or any ORM framework:

Why do we need a framework for ORM or JDBC programming?

-Cameron McKenzie


Well Cameron i did go through the thread provided by the link in your reply over here.Let me gladly accept that i really learned as where JDBC AND Hibernate do stand.Also i must admit that some concepts have just gone above my head as i said i am new to JDBC.

now having said this, i want to ask you a simple question ..

1)don't you think that first i have to go through the basics of JDBC by working out some java applications on oracle or some other database...then only i will be able to get a clear picture as what advantages Hibernate provides over JDBC. then only i will be able to get a clear picture as what advantages Hibernate provides over JDBC



2)Or else do you suggest that if i dive straight into Hibernate i can learn both JDBC AND HIBERNATE and work on some applications.


i have tried to apply my mind as i am a newbie , so please lead me to a right way. As Mr Prashanth has insisted , in his opinion, that first i learn JDBC then move to Hibernate.

Thanks for you replies...waiting for more...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JDBC OR HIBERNATE ?
 
Similar Threads
oracle for java
Help in Learning Advanced JAVA
Java JDBC PL/SQL Example Request
learning Ant
Java and PL/SQL