database access should be done into DAO (Data Access Objects) with CRUD methods 
(CReate Update Delete), having beans as
parameters and return values. Some call those beans 'domain model beans'.

DAO should have a way to get a JDBC connection according to current transaction. You 
can pass a connection as a method
argument (ugly, isn't it ?), or use something like springframework to handle 
transactions and jdbc connections for you.

DAO are used by business objets that have 'hi level' business methods. Your actions 
use this BO to get or update datas.

Nico.



----- Original Message ----- 
From: "Lin, Xinhua" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, June 24, 2004 3:05 PM
Subject: JDBC connection


Hi All,

I have a simple question. Where the jdbc connection should stay within a
struts application? And how to populate a javabean from the database and
let the action class know?



Thanks,



Xinhua




Our name has changed.  Please update your address book to the following format: 
"[EMAIL PROTECTED]".

This message contains information that may be privileged or confidential and is the 
property of the Capgemini Group. It is intended only for the person to whom it is 
addressed. If you are not the intended recipient,  you are not authorized to read, 
print, retain, copy, disseminate,  distribute, or use this message or any part 
thereof. If you receive this  message in error, please notify the sender immediately 
and delete all  copies of this message.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to