pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dave Cramer <pg@fastcrypt.com>
To: NosyMan <nosyman@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: jdbc and ARRAYs
Date: Fri, 2 Dec 2005 08:20:14 -0500
Message-ID: <40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com> (raw)
In-Reply-To: <200512021142.38982.nosyman@gmail.com>
References: <200512021142.38982.nosyman@gmail.com>

You have to implement the java.sql.Array interface and pass that in.
search the list, there's a few references to this question and some  
code.

Dave
On 2-Dec-05, at 4:42 AM, NosyMan wrote:

> Hi everyone,
>
> I have some problems trying to use a preparedStatement with an array
> parameter. The problem is I don't know how to do it :-(
>
> CREATE OR REPLACE FUNCTION MyFunction( id INTEGER, anArray
> VARCHAR[] )..........................
>
>
> pstat = conn.prepareStatement("SELECT * FROM MyFunction(?,?)");
> pstat.setInt(1, 30);
> pstat.setArray(2, ??????????);
>
> Can you tell me how can I construct the array for parameter number 2?
>
> Thanks,
> NosyMan
>
>
> ---------------------------(end of  
> broadcast)---------------------------
> TIP 6: explain analyze is your friend
>




view thread (11+ messages)  latest in thread

Message-ID: <40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com>
Permalink:  ../40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com/
Also on:    postgresql.org/message-id/40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: pg@fastcrypt.com, nosyman@gmail.com
  Subject: Re: jdbc and ARRAYs
  In-Reply-To: <40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com>
  References: <200512021142.38982.nosyman@gmail.com> <40ABA36E-B39E-40CE-979D-627EF0EDFE4B@fastcrypt.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox