Re: examples of SQL Arrays and jdbc?
От | Richard Welty |
---|---|
Тема | Re: examples of SQL Arrays and jdbc? |
Дата | |
Msg-id | E18gwPB-00029N-00@skipper.averillpark.net обсуждение исходный текст |
Ответ на | Re: examples of SQL Arrays and jdbc? (Eric B.Ridge <ebr@tcdi.com>) |
Список | 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 по дате отправления: