You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Mike Brooke <mb...@magstarinc.com> on 2002/02/27 15:06:08 UTC

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
 

AW: How best to get SQL:JDBC data?

Posted by Oliver Refle <o....@gmx.de>.
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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>