File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes hibernate to jdbc Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "hibernate to jdbc " Watch "hibernate to jdbc " New topic

hibernate to jdbc

Kruthi Gopal

Joined: Oct 09, 2012
Posts: 2
hi all!

i have started working in java only very recently.I am given a task to change the existing hibernate connectivity to normal JDBC as my project work.Can anyone suggest me how to do this?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15100

Welcome to the Ranch.

Wow, that's a big job for someone who has just started programming in Java. Do you have experience programming with databases?

Hibernate is an object-relational mapping (ORM) framework. It helps to map Java class hierarchies to and from tables in a relational database.

JDBC is Java's standard API for working with databases. When you work with JDBC, you deal directly with SQL statements, database tables, rows and columns. Writing a real application with only JDBC quickly becomes tedious - you'll notice you'll have to write a lot of code to translate database rows to Java objects and vice versa. (Hibernate was designed exactly to automate a lot of that, so that you don't have to write all that conversion code yourself).

If you would have to rewrite an application that uses Hibernate to an application that uses plain JDBC, you'd have to look through the code and rewrite all the code that does queries, updates etc. in the database. It's probably going to be a lot of work.

I wonder why anyone would want to do this. Is there a problem with Hibernate in your application which is so big that you have decided to give up on Hibernate and do it with plain JDBC instead?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Kruthi Gopal

Joined: Oct 09, 2012
Posts: 2
Hey there!

Thanks for the reply.Why I want to convert back to plain JDBC is because of its overhead.I don't have to work on larger databases so that hibernate would prove.After all,its not my idea! I am given to work on it:-(

Yes i do have some ideas working with databases, but have not worked with connectivity and stuff.Now that I am working on it,I studied 100 materials and all that I understand is only the theory part.But how do I actually go working on it is my trouble.Please help

I agree. Here's the link:
subject: hibernate to jdbc
It's not a secret anymore!