Re: examples of SQL Arrays and jdbc?

From: Richard Welty <rwelty(at)averillpark(dot)net>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: examples of SQL Arrays and jdbc?
Date: 2003-02-07 00:30:08
Message-ID: E18gwPB-00029N-00@skipper.averillpark.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Thu, 6 Feb 2003 19:11:15 -0500 "Eric B. Ridge" <ebr(at)tcdi(dot)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(at)averillpark(dot)net
Averill Park Networking 518-573-7592
Unix, Linux, IP Network Engineering, Security

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Dave Cramer 2003-02-07 01:27:19 Re: examples of SQL Arrays and jdbc?
Previous Message Eric B.Ridge 2003-02-07 00:11:15 Re: examples of SQL Arrays and jdbc?