6 messages in com.mysql.lists.javaRe: Newbie: easiest way to wrap Java ...
FromSent OnAttachments
Philippe de Rochambeau14 May 2004 01:58 
Stefan14 May 2004 04:59 
Kieran Kelleher14 May 2004 06:45 
john redden14 May 2004 12:58 
Matthew Hunter14 May 2004 14:29 
Will Glass-Husain14 May 2004 18:35 
Subject:Re: Newbie: easiest way to wrap Java classes around SQL statements
From:Matthew Hunter (matt@infodancer.org)
Date:05/14/2004 02:29:43 PM
List:com.mysql.lists.java

On Fri, May 14, 2004 at 10:58:52AM +0200, Philippe de Rochambeau
<phil@wwphi.net> wrote:

I would like to write Java classes that query a MySQL database. I plan to use Tomcat as application server.

What is the easiest way to make access to the MySQL database as object-oriented as possible? Is there some kind of pattern for this?

My initial guess is that I should create a Java class for each table and manager classes with static methods to insert, delete, etc. rows into the database tables. For instance,

I had a similar problem and ended up solving it by writing my own DB layer, along with extensions to make it easy to use for web development. See the org.infodancer.db package from the link below.

http://www.infodancer.org/software/classes.jsp

svn://infodancer.org/classes

The documentation is very much "dive in, sink or swim", but at least in my opinion it's worth it. Tested primarily with MySQL, but I use it with MS-SQL Server 7 sometimes.