You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ddlutils-user@db.apache.org by Jun Li <al...@gmail.com> on 2006/05/08 01:54:06 UTC

How to read xml data into a collection of dynabean?

I want to use platform.getUpdateSql(), platform.store() and other
methods that relate with dynabean. But, how can I read xml data into a
collection of dynabean?

I see the DataReader can only read data for inserting.

--
--------------
Cheers,
Jun

Re: How to read xml data into a collection of dynabean?

Posted by Thomas Dudziak <to...@gmail.com>.
On 5/9/06, Jun Li <al...@gmail.com> wrote:

> Thanks Tom, but I want to retrieve data from xml file not database.

In that case, simply create your own implementation of the DataSink
interface (DdlUtils only provides the DataToDatabaseSink
implementation of this interface, but its really a simple interface)
and use that with the DataReader. You can have a look at the
WriteDataToDatabaseCommand class to see how these are wired (esp. in
combination with the model and possible converters).

Tom

Re: How to read xml data into a collection of dynabean?

Posted by Jun Li <al...@gmail.com>.
Thanks Tom, but I want to retrieve data from xml file not database.


On 5/8/06, Thomas Dudziak <to...@gmail.com> wrote:
>
> On 5/8/06, Jun Li <al...@gmail.com> wrote:
>
> > I want to use platform.getUpdateSql(), platform.store() and other
> > methods that relate with dynabean. But, how can I read xml data into a
> > collection of dynabean?
> >
> > I see the DataReader can only read data for inserting.
>
> Via the query and fetch methods in the platform you can retrieve data
> from a database. You can also look into the WriteDataToFileCommand
> class to see how these might be used to generate XML via StAX.
>
> Tom
>



--
--------------
Cheers,
Jun

Re: How to read xml data into a collection of dynabean?

Posted by Thomas Dudziak <to...@gmail.com>.
On 5/8/06, Jun Li <al...@gmail.com> wrote:

> I want to use platform.getUpdateSql(), platform.store() and other
> methods that relate with dynabean. But, how can I read xml data into a
> collection of dynabean?
>
> I see the DataReader can only read data for inserting.

Via the query and fetch methods in the platform you can retrieve data
from a database. You can also look into the WriteDataToFileCommand
class to see how these might be used to generate XML via StAX.

Tom