GeeCON Prague 2014*
The moose likes Object Relational Mapping and the fly likes Using Hibernate for developing Information System in Java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Using Hibernate for developing Information System in Java" Watch "Using Hibernate for developing Information System in Java" New topic
Author

Using Hibernate for developing Information System in Java

Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

Hi all,

I have some queries that need to be addressed. I would be really helpful if someone can help me out:
I have project at hand - to develop an information system- Any IS. I am planning to use Java as the front end with Oracle or MySql as Back end. So i am not pretty sure which one goes well with Java- Oracle or MySQL. And i have heard about Hibernate from my friend which will ease the Object Relational Mapping. Can Hibernate be used for developing the IS? What about JDBC? Will there be a need for JDBC if one's using Hibernate.

I am very new to Hibernate and JDBC. But have done loads of coding in Java. So please help me out in deciding:
1. Which back end to use with Java.
2. Hibernate - Can it be used for Information System development.
3. JDBC- How's it different from Hibernate


Mohamed Sanaulla | My Blog
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Can Hibernate be used for developing the IS?

Yes.

What about JDBC?

Yes as well

Will there be a need for JDBC if one's using Hibernate.

Yes. Hibernate uses JDBC to talk to the database.


1. Which back end to use with Java.

Either Oracle or MySQL would be fine.


2. Hibernate - Can it be used for Information System development.

It can be used for any Java application that uses a relational database.


3. JDBC- How's it different from Hibernate

It is much more low-level. It provides the nuts and bolts of how Java communicates with a database. Hibernate extends on this to abstract away from the basics.
[ June 10, 2008: Message edited by: Paul Sturrock ]

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

As far as 'which back end to use', I might be a bit more egalitarian than Paul and let you know that pretty much any JDBC compliant database can be used with Hibernate. The examples on my website use MySQL, but in my daily life, I work with IBM, so I'm always connecting to db2.

Hibernate does translate all of its calls into SQL statements that are marshalled to the database through JDBC, so while you develop your persistence based applications in a very object-oriented way through Hibernate, in the end, it all gets turned into SQL.

-Cameron McKenzie
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

@Paul Sturrock:
Thanks for your step by step reply. Thanks a lot once again.

@Cameron Wallace McKenzie:
Thanks a lot for your useful reply.

I have purchased "Java Persistence with Hibernate" book.

What are the prerequisites for learning Hibernate? Does knowledge of EJB is required?
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

I've got a variety of tutorials on my site that will get you started. I might even recommend doing those before getting too deep into Java Persistence with Hibernate. It's a very advanced book - the most complete book on Hibernate out there. But sometimes a good, simple example will help you get started and build some confidence.

Simple Hibernate Examples - Getting Started

What do you need to get started? A database, JDK 1.5 or better if you want to use annotations, JDBC drivers for your database, and the Hibernate core and Hibernate Annotations library (optional) downloaded from Hibernate.org. That's all you need to get going.

I've got a tutorial on youtube that shows you how to set up a windows machine for doing Hibernate programming:

Setting Up a Windows Machine for Java Hibernate Development with JPA Annotations

No knowledge of EJBs is required. However, much of what you learn will become useful if you start using EJB3 in your applications.

When you run into problems, post back here, and let us help you out.

-Cameron McKenzie
[ June 10, 2008: Message edited by: Cameron Wallace McKenzie ]
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

@Cameron Wallace McKenzie:
Thanks a lot for a detailed reply. And i was going through your website. Seems like i need to get started at the earliest. I am planning to use MySql database on Ubuntu 8.04.

And i will surely get back to the forum for my doubts as i proceed with my course of study.
Thanks once again
Mohamed Sanaulla
Saloon Keeper

Joined: Sep 08, 2007
Posts: 3071
    
  33

One more thing i forgot to ask-
What is iBatis and how is it different from Hibernate?
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Using Hibernate for developing Information System in Java