Re: Fwd: JDBC Array double precision [] error

From: Hannes Erven <hannes(at)erven(dot)at>
To: pgsql-general(at)postgresql(dot)org
Cc: juampick(at)gmail(dot)com
Subject: Re: Fwd: JDBC Array double precision [] error
Date: 2013-03-31 22:38:28
Message-ID: 5158BAE4.7080701@erven.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

Hi Juan Pablo,

> double[] array = (double[]) rs1.getArray("histograma").getArray();
> java.lang.ClassCastException: [Ljava.lang.Double; cannot be cast to [D

The error message already tells you the solution: use Double, not double.

Like this:
Double[] array = (Double[]) rs1.getArray("histograma").getArray();

Best regards,

-hannes

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gavan Schneider 2013-03-31 22:45:50 Re: Money casting too liberal?
Previous Message Lee Hachadoorian 2013-03-31 22:32:12 Current Schema for Functions called within other Functions

Browse pgsql-jdbc by date

  From Date Subject
Next Message Juan Pablo Cook 2013-03-31 22:49:06 Re: Fwd: JDBC Array double precision [] error
Previous Message Juan Pablo Cook 2013-03-31 22:08:18 Fwd: JDBC Array double precision [] error