Обсуждение: newbie question

Поиск
Список
Период
Сортировка

newbie question

От
prashanth bhat
Дата:
hi all,

Is it possible to store java Objects in postgres and
invoke methods on them??. Is it possible to store XML
in postgres?.

please reply ASAP

thanx in adv.
prashanth

__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail.
http://personal.mail.yahoo.com/

Re: newbie question

От
Doug McNaught
Дата:
prashanth bhat <prashanth_bhat@yahoo.com> writes:

> hi all,
>
> Is it possible to store java Objects in postgres and
> invoke methods on them??. Is it possible to store XML
> in postgres?.

The answer to both your questions is "yes, but..."

Any Java object that implements Serializable can be serialized into a
byte stream, which can them be stored as a BLOB in Postgres.  You
can't invoke methods on it in that form; you have to read it back in
and de-serialize it into a real object.

XML is text, and can be stored in Postgres like any other chunk of
text.  To do anything with it, though, you'll need to read it back out
and parse it using SAX or another XML parser.

Hope this helps...

-Doug