Re: How to modify my class inherited from java.sql.Array

From: Kris Jurka <books(at)ejurka(dot)com>
To: vasylenko(at)uksatse(dot)org(dot)ua
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: How to modify my class inherited from java.sql.Array
Date: 2007-04-16 16:45:05
Message-ID: Pine.BSO.4.64.0704161240300.24838@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mon, 16 Apr 2007, vasylenko(at)uksatse(dot)org(dot)ua wrote:

> I need to update (and insert too) an Array type into table via JDBC. Array
> consist of Strings;
>
> The method ResultSet -> setObject(i,arrayClassObject) - works well.
>
> But after the method ResultSet -> updateRow() generate the exception
> ClassCastException.
>
> How can I modify my ArrayClass to avoid such exception?
>

Actually it's a mistake in the driver. The switch needs to accomodate
Types.ARRAY. I've applied a fix to cvs for the 8.0, 8.1, 8.2, and head
branches and will go out in the next release (hopefully in about a week).
A jar file built with the fix is available here:

http://www.ejurka.com/pgsql/jars/va/

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Kris Jurka 2007-04-16 16:53:55 Re: Prepared Statements: Inefficient Type Conversion?
Previous Message Tom Lane 2007-04-16 16:06:43 Re: Bug in timezone-parsing?