Skip site navigation (1) Skip section navigation (2)

Re: Advice fetching Array data with JDBC 8.3 driver

From: Kris Jurka <books(at)ejurka(dot)com>
To: Woody Woodring <george(dot)woodring(at)iglass(dot)net>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Advice fetching Array data with JDBC 8.3 driver
Date: 2008-03-27 03:23:07
Message-ID: 47EB131B.7050900@ejurka.com (view raw or flat)
Thread:
Lists: 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

In response to

pgsql-jdbc by date

Next:From: Steven vargaDate: 2008-03-27 04:46:03
Subject: performance issue
Previous:From: Petite AbeilleDate: 2008-03-26 19:48:10
Subject: Re: Non-ORM layers over JDBC

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group