Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 29F262E32DC for ; Sat, 1 Dec 2007 08:35:44 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 90539-06 for ; Sat, 1 Dec 2007 08:35:33 -0400 (AST) Received: from beaver.fastcrypt.com (beaver.fastcrypt.com [64.7.141.17]) by postgresql.org (Postfix) with ESMTP id 0C65F2E0032 for ; Sat, 1 Dec 2007 08:35:40 -0400 (AST) Received: from [192.168.1.14] (dcdsl.ebox.com [64.7.143.116]) by beaver.fastcrypt.com (Postfix) with ESMTP id 3B5471580521; Sat, 1 Dec 2007 07:47:23 -0500 (EST) From: Dave Cramer To: Christian Kindler In-Reply-To: <20071130174305.288040@gmx.net> Subject: Re: prepared statement using postgres array X-Priority: 3 References: <20071130140744.141200@gmx.net> <77FD84BA-A86E-4037-9735-115CF1A077B4@fastcrypt.com> <20071130174305.288040@gmx.net> Message-Id: <34910563-FEAB-4FF9-9381-E4D7DC3537F5@fastcrypt.com> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v915) Date: Sat, 1 Dec 2007 07:35:38 -0500 Cc: pgsql-jdbc@postgresql.org X-Mailer: Apple Mail (2.915) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/6 X-Sequence-Number: 17861 Christian, I'm doing this from memory so you may have to adjust. you really only need to implement toString on the interface. and the getBaseType. the method has to output "{e0,e1,e2...}" Where eN is the element of the array Dave On 30-Nov-07, at 12:43 PM, Christian Kindler wrote: > 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