Skip site navigation (1) Skip section navigation (2)

Re: prepared statement using postgres array

From: "Christian Kindler" <christian(dot)kindler(at)gmx(dot)net>
To: Dave Cramer <pg(at)fastcrypt(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: prepared statement using postgres array
Date: 2007-11-30 17:43:05
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-jdbc
Hi Dave

> you have to implement the java.sql.Array

hmmm ... i have tried to find a sample implementation of the interface, but no success.

I am sure this is a ugly solution but I figures out a workaround:

INSERT INTO Quote(fi_id, market_id, "date", "time",
                  "open", high, low, "close", vol, oi,
                  bid, bidvol, ask, askvol,
                  buyers,  buyersvol, sellers, sellersvol,
           VALUES(?, ?, ?, ?,
                  ?, ?, ?, ?, ?, ?,
                  ?, ?, ?, ?,
                  (select string_to_array(?, ',')::float[]),
                  (select string_to_array(?, ',')::float[]),
                  (select string_to_array(?, ',')::float[]),
                  (select string_to_array(?, ',')::float[]),
                  (select string_to_array(?, ',')::float[])

 ... as is said not pretty but it works for the moment ...


PS But it still will be cool if anybody could provide me a sample snipped implementing java.sql.Array


Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden:

In response to


pgsql-jdbc by date

Next:From: Roy SmithDate: 2007-12-01 07:52:36
Subject: "create type" custom types not supported by JDBC
Previous:From: Dave CramerDate: 2007-11-30 16:40:14
Subject: Re: prepared statement using postgres array

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group