This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JDBC and the fly likes Classes with Databases question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Classes with Databases question" Watch "Classes with Databases question" New topic
Author

Classes with Databases question

Alan Smith
Ranch Hand

Joined: Oct 19, 2011
Posts: 152

Hi,

I have never used databases with Java but I have to start now. They are very useful to use with my programs but I have noticed that since using them I haven't got much use for classes yet. A simple example: If I make a program dealing with employees and fill up the database with their entered information, I dont even need a class for the employees. I can add them straight into the database using sql statements, therefore what is the point in making classes for them? Could someone give me info or reasons why to use classes for entities I add to a database? I hope that came across as understandable.

Thanks.
Tim Moores
Rancher

Joined: Sep 21, 2011
Posts: 2408
Maybe you need to work with those entities in your Java code as well...? It's much easier to handle an object than a number of individual values.

Also, while it's certainly possible to get by with raw JDBC, you need objects for any ORM system (like JPA, Hibernate etc.), which most people are using these days instead of raw JDBC.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Classes with Databases question
 
Similar Threads
Proper way to store and retrieve information
How to backuping data by using Hibernate?..
using a local database
image uploading in order to save to database
Number of databases can be used in single JBoss server ?