On Wed, 2003-11-05 at 21:34, Kasia Lale wrote:
> Hi,
> 
> I'm hoping somebody can point me in the right direction, please...
> 
> I've been looking at Woody and the bean binding sample included in 2.1.(x),
> and wondering how i can synchronize the bean with the database, or at least
> what's the best way of doing this.

Note that if you just want a form to edit something that is in a
database, you don't need a bean and you don't need the binding. The
shortest path is probably using the database.js to get your data from
the database and set the values directly on the form object. And
similary, when saving, just get the values directly from the form and
pass them on to the SQL statement.

> 
> >From reading other posts, I'm thoroughly confused! Best I can figure, the
> options are:
> 
> * code the connection into the bean itself (or Helper class), using ctx
> lookup. [How can Helper class be Composable, or does Helper by-pass Avalon
> entirely, perhaps with direct jndi/j2ee datasource lookup?]

lookup the connection from flowscript, and pass it on to the helper
class, or alternatively make the helper class into an Avalon component,
and declare it in the cocoon.xconf, and then lookup that component from
the flowscript.

> 
> * use javascript such as database.js included in the petstore sample to get
> a DataSourceComponent/connection and update the bean to/from db in the
> (woody) flowscripts
> 
> * use Actions (Composable) to lookup a DataSourceComponent and handle db
> interraction. How to reference the user's stored (continuation) bean
> instance data?
> 
> Just for the record, I'm aware of the O/R mapping possibilities using OJB,
> and Hibernate, but think I need more basic understanding before potentially
> tackling these options. I've also read with interest how betwixt/castor can
> be used to output XML representation of a bean for Woody to bind to, but
> would still have to ask, how/where can db synchronization be handled?
> 
> Thanks for any pointers
> James

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
[EMAIL PROTECTED]                          [EMAIL PROTECTED]


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

Reply via email to