JDBC OR HIBERNATE ?

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

Posts: 245

posted 8 years ago

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

Posts: 28

posted 8 years ago

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.

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.

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.

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

Posts: 28

posted 8 years ago

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

Posts: 28

posted 8 years ago

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:

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.