Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

hibernate to jdbc

 
Kruthi Gopal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 15369
40
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Kruthi Gopal
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic