Re: examples of SQL Arrays and jdbc? - Mailing list pgsql-jdbc

From Richard Welty
Subject Re: examples of SQL Arrays and jdbc?
Date
Msg-id E18gwPB-00029N-00@skipper.averillpark.net
Whole thread Raw
In response to Re: examples of SQL Arrays and jdbc?  (Eric B.Ridge <ebr@tcdi.com>)
List pgsql-jdbc
On Thu, 6 Feb 2003 19:11:15 -0500 "Eric B. Ridge" <ebr@tcdi.com> wrote:

> On Thursday, February 6, 2003, at 06:18  PM, Richard Welty wrote:
> > out, e.g. i can extract an int [] easily but i have to convert it to an
> > Integer [] in order to write it back out. it can't really be this bad,
> > can it?

> Postgres is cool in that you can do a stmt.setString(...) (if using
> prepared statements) for any datatype, including arrays.

> Postgres' string form of an array is (in its simplest form):
>         {1, 2, 3, N}
>                 or
>         {"a", "b", "c", "N"}

> So you can convert your int[] into a String in the above form and just
> do:
>         stmt.setString(3, Helper.arrayToPostgresString(myIntArray));

ah, ok, thanks. my path is now clear.

richard
--
Richard Welty                                         rwelty@averillpark.net
Averill Park Networking                                         518-573-7592
              Unix, Linux, IP Network Engineering, Security

pgsql-jdbc by date:

Previous
From: Eric B.Ridge
Date:
Subject: Re: examples of SQL Arrays and jdbc?
Next
From: Dave Cramer
Date:
Subject: Re: examples of SQL Arrays and jdbc?