Re: Advice fetching Array data with JDBC 8.3 driver - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: Advice fetching Array data with JDBC 8.3 driver
Date
Msg-id 47EB131B.7050900@ejurka.com
Whole thread Raw
In response to Advice fetching Array data with JDBC 8.3 driver  ("Woody Woodring" <george.woodring@iglass.net>)
List pgsql-jdbc
Woody Woodring wrote:
> Upgrading to the latest 8.3 JDBC driver broke one of our queries (that we
> have found) that involves arrays in the database.  Reverting to the latest
> 8.2 driver fixes it.
>
>  int[] hdata = (int[])(rs.getArray("data")).getArray();
>

The 8.3 driver is returning this as Integer[] instead of the primitive
int[] because the server allows null values in arrays.  While null array
elements are possible in the server since 8.2, the driver didn't get
updated until 8.3.  You can change your code or provide the
"compatible=8.2" URL parameter to your connection URL.

Kris Jurka

pgsql-jdbc by date:

Previous
From: Petite Abeille
Date:
Subject: Re: Non-ORM layers over JDBC
Next
From: Steven varga
Date:
Subject: performance issue