Re: XMLForm & mod-db

2002-08-27 Thread Christian Haul

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
 from a , where the  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
[EMAIL PROTECTED]
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. 

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




Re: XMLForm & mod-db

2002-08-26 Thread Bobby Mitchell

Christian Haul wrote:

>On 24.Aug.2002 -- 09:01 AM, Ivelin Ivanov wrote:
>  
>
>>I am not very familiar with the modular db actions,
>>but from what I understand, you would be able to specify the name
>>of the session attribute where the modular db actions would read/write. You
>>can point the XMLForm model to the same bean.
>>
>>
>>
>>>I want to use XMLForm and the Modular Database actions together. I have
>>>looked for information and can't find out if this can be done or not.
>>>
>>>Can it be done?
>>>
>>>If so, how would I go about populating the java bean with information
>>>from the database?
>>>  
>>>
>
>Unfortunately, I haven't gotten up to speed with XMLForm, so I
>cannot give full advice. Anyway, the point with the mod-db actions
>is, that you can read / write data from / to arbitrary sources, as
>long as you have a class that does it and conforms to the InputModule
>/ OutputModule interfaces.
>
>So, if you know how to locate your bean instance, it would be trivial
>to write such a class. Supplied are currently only classes that write
>to session attributes or request attributes.
>
>Data can be read from a lot more sources, even complicated setups
>like reding an entry of a java.util.Map stored in a request attribute
>together with a default value are possible. You can chain those 
>InputModules that carry the "meta" part in their name for a great
>flexibility.
>
>I assume that this is going to be requested more frequently, so it
>would be nice if you could keep us updated. 
>
>   Chris.
>  
>
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?

-- 
Robert J. (Bobby) Mitchell
Systems Administrator
NASA Institute for Advanced Concepts
555A 14th St Atlanta, Ga. 30318
Phone: (404)347-9633 Fax: (404)347-9638





-
Please check that your question  has not already been answered in the
FAQ before posting. 

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