pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
how to create an object of java.sql.Array 2+ messages / 2 participants [nested] [flat]
* how to create an object of java.sql.Array @ 2004-11-18 22:00 jessica xingzc_he <xingzc_he@hotmail.com> 2004-11-18 22:22 ` Re: how to create an object of java.sql.Array Oliver Jowett <oliver@opencloud.com> 0 siblings, 1 reply; 2+ messages in thread From: jessica xingzc_he @ 2004-11-18 22:00 UTC (permalink / raw) To: pgsql-jdbc hi guys, support the data type of a column is int[], i can use ResultSet.updateArray(int, Array) to update it, right? My question is how to create an instance of java.sql.Array to pass in updateArray? BTW, does 7.4.x postgresql jdbc driver support RowSet? thanks zhenchang ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: how to create an object of java.sql.Array 2004-11-18 22:00 how to create an object of java.sql.Array jessica xingzc_he <xingzc_he@hotmail.com> @ 2004-11-18 22:22 ` Oliver Jowett <oliver@opencloud.com> 0 siblings, 0 replies; 2+ messages in thread From: Oliver Jowett @ 2004-11-18 22:22 UTC (permalink / raw) To: jessica xingzc_he <xingzc_he@hotmail.com>; +Cc: pgsql-jdbc jessica xingzc_he wrote: > support the data type of a column is int[], i can use > ResultSet.updateArray(int, Array) to update it, right? My question is > how to create an instance of java.sql.Array to pass in updateArray? The driver does not really support setArray() / updateArray() for arbitary Array implementations. I had a patch to fix this ages ago but it has rotted since then, and was never really the right way to do it anyway. You can provide your own implementation of Array and it should work so long as: - it implements Array.getBaseTypeName(), returning the underlying element type name ("int" in your case). - it implements Array.toString(), returning an array constant formatted as the postgresql backend expects (e.g. "{1,2,3}"). > BTW, does 7.4.x postgresql jdbc driver support RowSet? As I understand it, RowSet isn't meant to be implemented by drivers, it is a layer that sits on top of the driver. I don't know how well implementations of RowSet work with the current driver. -O ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-11-18 22:22 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2004-11-18 22:00 how to create an object of java.sql.Array jessica xingzc_he <xingzc_he@hotmail.com> 2004-11-18 22:22 ` Oliver Jowett <oliver@opencloud.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