pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
persistence of java objects
4+ messages / 4 participants
[nested] [flat]

* persistence of java objects
@ 2004-10-30 23:05 jessica xingzc_he <xingzc_he@hotmail.com>
  2004-10-31 15:38 ` Re: persistence of java objects Dave Cramer <pg@fastcrypt.com>
  2004-10-31 20:29 ` Re: persistence of java objects Ulrich Meis <kenobi@halifax.rwth-aachen.de>
  2004-11-09 16:48 ` Re: persistence of java objects Markus Schaber <schabios@logi-track.com>
  0 siblings, 3 replies; 4+ messages in thread

From: jessica xingzc_he @ 2004-10-30 23:05 UTC (permalink / raw)
  To: pgsql-jdbc

hi,

Does postgresql support this? if i want a column of a table for the 
persistence of instance of java objects, and use ResultSet.getObject() and 
ResultSet.updateObjecct() to access them. if so, what data type the column 
should be?

thanks
zhenchang





^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: persistence of java objects
  2004-10-30 23:05 persistence of java objects jessica xingzc_he <xingzc_he@hotmail.com>
@ 2004-10-31 15:38 ` Dave Cramer <pg@fastcrypt.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Dave Cramer @ 2004-10-31 15:38 UTC (permalink / raw)
  To: jessica xingzc_he <xingzc_he@hotmail.com>; +Cc: pgsql-jdbc

Hi,

postgresql doesn't support this they way I suspect you are thinking of it.

How do other databases do this ?

dave

jessica xingzc_he wrote:

> hi,
>
> Does postgresql support this? if i want a column of a table for the 
> persistence of instance of java objects, and use ResultSet.getObject() 
> and ResultSet.updateObjecct() to access them. if so, what data type 
> the column should be?
>
> thanks
> zhenchang
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: persistence of java objects
  2004-10-30 23:05 persistence of java objects jessica xingzc_he <xingzc_he@hotmail.com>
@ 2004-10-31 20:29 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
  2 siblings, 0 replies; 4+ messages in thread

From: Ulrich Meis @ 2004-10-31 20:29 UTC (permalink / raw)
  To: jessica xingzc_he <xingzc_he@hotmail.com>; +Cc: pgsql-jdbc

On Sunday 31 October 2004 01:05, jessica xingzc_he wrote:
> hi,
>
> Does postgresql support this? if i want a column of a table for the
> persistence of instance of java objects, and use ResultSet.getObject() and
> ResultSet.updateObjecct() to access them. if so, what data type the column
> should be?

If you use a standard type like integer or varchar, you can do things like

setObject(1,new Integer(5));
setObject(2,"something");

which would be equivalent to

setInteger(1,new Integer(5));
setString(2,"something");

If you want to store complex objects in the database then they should 
implement the java.io.serializable interface. Thereby you can store them in a 
byteArray or push them into a bytearraystream and write the result with the 
usual methods into the database.
A simple serialization example is here for java.io.File:

http://java.sun.com/j2se/1.3/docs/guide/serialization/spec/examples.doc1.html

Regards,

Uli




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: persistence of java objects
  2004-10-30 23:05 persistence of java objects jessica xingzc_he <xingzc_he@hotmail.com>
@ 2004-11-09 16:48 ` Markus Schaber <schabios@logi-track.com>
  2 siblings, 0 replies; 4+ messages in thread

From: Markus Schaber @ 2004-11-09 16:48 UTC (permalink / raw)
  To: pgsql-jdbc; +Cc: jessica xingzc_he <xingzc_he@hotmail.com>

Hi, Jessica,

On Sat, 30 Oct 2004 17:05:44 -0600
"jessica xingzc_he" <xingzc_he@hotmail.com> wrote:

> Does postgresql support this? if i want a column of a table for the 
> persistence of instance of java objects, and use ResultSet.getObject() and 
> ResultSet.updateObjecct() to access them. if so, what data type the column 
> should be?

Currently, there's no support for general Java objects.

But maybe what you really need is a persistance framework. Hibernate
currently seems to be a reasonable one, and it supports PostgreSQL.

HTH,
Markus

-- 
markus schaber | dipl. informatiker
logi-track ag | rennweg 14-16 | ch 8001 zürich
phone +41-43-888 62 52 | fax +41-43-888 62 53
mailto:schabios@logi-track.com | www.logi-track.com



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2004-11-09 16:48 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-10-30 23:05 persistence of java objects jessica xingzc_he <xingzc_he@hotmail.com>
2004-10-31 15:38 ` Dave Cramer <pg@fastcrypt.com>
2004-10-31 20:29 ` Ulrich Meis <kenobi@halifax.rwth-aachen.de>
2004-11-09 16:48 ` Markus Schaber <schabios@logi-track.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox