File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Is there anything close to Active Record for Java? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Is there anything close to Active Record for Java?" Watch "Is there anything close to Active Record for Java?" New topic
Author

Is there anything close to Active Record for Java?

Robert Hill
Ranch Hand

Joined: Feb 24, 2006
Posts: 94
It might be a pointless question, since Java is so different then Ruby.

For those not familiar with Active Record it is a wonderful tool for Ruby on Rails. It abstracts SQL statements into Ruby method calls. Ruby is flexible enough to handle creating new methods for a class dynamically.

As an example:

Message.new(params[:message]).save creates and saves a new row in the Message table using parameters from a HTML form. The Message class has dynamically created methods to manipulate the row, and makes validation a breeze.

Before this sounds like an ad for Ruby on Rails, and a condemnation, which is not the intent, here is my question. Most of the SQL I use is the same sort of thing over and over. So it is tedious to have to write SQL statements in Java code. Before I attempt to write some simple wrappers to help DRY out some Java code, Does something like this already exist for Java. I doubt Java has something exactly the same, but something reasonably close would be great.

Thanks!
 
jQuery in Action, 2nd edition
 
subject: Is there anything close to Active Record for Java?
 
Similar Threads
why choosing groovy over ruby, python, jython, etc.
Ruby on Rails or the joy of instant feedback.
I don't know Ruby on Rails: can RoR and Java be in the same app?
use of object oriented scripting
Ruby? Prospects