Re: Fwd: JDBC Array double precision [] error

Поиск
Список
Период
Сортировка
От Juan Pablo Cook
Тема Re: Fwd: JDBC Array double precision [] error
Дата
Msg-id CAKge45Lp=geE_T3723H8hp6dM9-D2hTAZiwT1u5WqVouAmysdQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Fwd: JDBC Array double precision [] error  (Hannes Erven <hannes@erven.at>)
Список pgsql-general
Hi Hannes... 
Thanks a lot for your help! 
I was stuck being many many hours trying and googling it the problem but didn't realize that.

This: Double[] array = (Double[]) rs1.getArray("histograma").getArray(); solve my problem!

Thanks again!!

Juan Cook




On Sun, Mar 31, 2013 at 7:38 PM, Hannes Erven <hannes@erven.at> wrote:
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

В списке pgsql-general по дате отправления:

Предыдущее
От: Gavan Schneider
Дата:
Сообщение: Re: Money casting too liberal?
Следующее
От: Tim Uckun
Дата:
Сообщение: Using varchar primary keys.