Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

Re: [JDBC] prepared statement using postgres array

From: Christian Kindler <christian.kindler(at)gmx.net>
Date: Fri Nov 30 2007 - 12:43:05 EST


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,
                  last,
                  sysstatus,
                  buyers,  buyersvol, sellers, sellersvol,
                  additional)
           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 ...

Thanks!
Christian

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

-- 
cu
Chris

Ist Ihr Browser Vista-kompatibel? Jetzt die neuesten 
Browser-Versionen downloaden: 
http://www.gmx.net/de/go/browser

---------------------------(end of broadcast)---------------------------
TIP 3: Have you checked our extensive FAQ?

               
http://www.postgresql.org/docs/faq
Received on Fri Nov 30 12:43:48 2007
Do you need help?X

This archive was generated by hypermail 2.1.8 : Wed Jun 18 2008 - 23:40:43 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library