struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oliver Refle <o.re...@gmx.de>
Subject AW: How best to get SQL:JDBC data?
Date Wed, 27 Feb 2002 14:25:59 GMT
Hi Mike,
normally i take the Action classes to collect all my data. Maybe you
should implement a Data Access Object which offers an API to access the
database and
returns the result. In the action you collect all the data you need
(means you use the methods of your DAO ) and then on the JSP you
simply present the collected Data.
So you seperate business logic from database access and from presentation

Oliver

-----Ursprungliche Nachricht-----
Von: Mike Brooke [mailto:mbrooke@magstarinc.com]
Gesendet: Mittwoch, 27. Februar 2002 15:06
An: Struts Users Mailing List
Betreff: How best to get SQL:JDBC data?


Hello Everyone,

I am new to using struts and I have a design issue.  Is it better to use
an Action servlet to create a bean of data from a database, or is it
better to create a taglibs that would return the bean.  Another solution
could be to use the dbTag taglibs from the Jakarta-taglibs and build the
bean using jsp scripts (but I have read that this is not the ideal way
if you are using the struts framework).  My query is to find data in our
inventory table, currently the system scripts the database (SQL:jdbc)
calls as a jsp script and has different <jsp:include> files to return
either prices or descriptions and create the form.

Even if you have url links that I can do more research that would be
great.  I do have the WROX's Professional JSP 2nd edition, but so far I
have not come across any examples using the jdbc database.  I have set
the database up using the datasource as suggest in the Utilities section
of the struts documentation.

// eom
//                Michael A. Brooke
//                Magstar Inc.
// e-mail:     mbrooke@magstarinc.com
// phone:     (416) 447-1442 x 273



--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message