pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: Assad Jarrahian <jarraa@gmail.com>
To: pgsql-jdbc@postgresql.org
Subject: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()]
Date: Sat, 12 Nov 2005 10:21:32 -0700
Message-ID: <4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.com> (raw)
Hello all,
my apologies if this question has been asked before. I looked
through the archives could not find the relevant info (if I overlooked
something, sorry).
int[] intarray = new int[1];
getAssociatedLMs.setObject(1, intarray, java.sql.Types.ARRAY);
//getAssociatedLM's is a callable statement ("{call getLMs(?,?) } ");
so I get a compilation error saying
org.postgresql.util.PSQLException: Cannot cast an instance of [I to
type Types.ARRAY
at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1637)
at org.postgresql.jdbc3.AbstractJdbc3Statement.setObject(AbstractJdbc3Statement.java:1435)
at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1652)
at //the setObjectLineAbove
IF I change it to type Integer[]
org.postgresql.util.PSQLException: Cannot cast an instance of
[Ljava.lang.Integer; to type Types.ARRAY
at org.postgresql.jdbc2.AbstractJdbc2Statement.setObject(AbstractJdbc2Statement.java:1637)
......
I notice Dave Cramer mentioned something about this could be an
easier process. But what is the process now? (aka, am I completely
off?)
Much thanks in advance.
Assad
view thread (7+ messages) latest in thread
Message-ID: <4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.com> Permalink: ../4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.com/ Also on: postgresql.org/message-id/4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.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: jarraa@gmail.com Subject: Re: passing array as parameters to PrepareStatement or callable statement.[setObject() or setArray()] In-Reply-To: <4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.com> References: <4bd3e1480511120921y6359a0achab46a321b4802219@mail.gmail.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