cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <h...@dvs1.informatik.tu-darmstadt.de>
Subject Re: XMLForm & mod-db
Date Tue, 27 Aug 2002 07:40:22 GMT
On 26.Aug.2002 -- 02:49 PM, Bobby Mitchell wrote:
> I would like to use mod-db to retrieve info from a database, but the 
> mod-db example uses esql. Can I use DatabaseQueryAction to do this, and 
> if so, how?

There are two options: DatabaseSelectAction and
DatabaseQueryAction. Unless you have special needs, I would suggest to
use the DatabaseSelectAction.

For the general use, see documentation in User Docs -> Actions -> Database

The select action constructs a query for you that retrieves all
<values/> from a <table @name/>, where the <keys/> equal the given
values. The retrieved data + the keys are available to sitemap as
parameters and the values plus a row count will be send to the
specified OutputModule.

The query action does not construct the query but uses a given
statement that needs to conform to the prepared statement
syntax. Depending on an attribute it will try to set either the keys
or both keys and values using the setXXX methods. It's your obligation
to sprinkle the right number of ?s in your query. Again, any retrieved
data will be available to sitemap and OutputModule as described
above.

If you want to display the results, you'd need to retrieve these
values again. Thus I would recommend to use esql. If you need this
data earlier in your pipeline, use the actions.

HTH.

	Chris.
-- 
C h r i s t i a n       H a u l
haul@informatik.tu-darmstadt.de
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message