Fwd: JDBC Array double precision [] error

Поиск
Список
Период
Сортировка
От Juan Pablo Cook
Тема Fwd: JDBC Array double precision [] error
Дата
Msg-id CAKge45+cZpDVsGoYPdVew0haNs9mpq_i-qegaBKxnWDCiKQagQ@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fwd: JDBC Array double precision [] error
Список pgsql-general
Hi everyone! I need your help with this problem.
 
I'm using PostgreSQL 9.2 Server & the latest jdbc driver: postgresql-9.2-1002.jdbc4.jar

I have a table with this column array: 
 -- histograma double precision[]

And I want to retrieve this and cast into java to double[] but I can't.

This is the extract of the code:

Statement stat1 = con.createStatement();
ResultSet rs1 = stat1.executeQuery("SELECT * FROM \"Vector\");

while (rs1.next()) {

double[] array = (double[]) rs1.getArray("histograma").getArray();

}

And the error: 
"
Exception in thread "AWT-EventQueue-0" java.lang.ClassCastException: [Ljava.lang.Double; cannot be cast to [D
"
Also I tried to do a for loop but didn't work.

Can you help me? 

Thanks a lot! ;)


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

Предыдущее
От: "Enke, Dr., Michael"
Дата:
Сообщение: in C trigger function find out if column is part of primary key
Следующее
От: Lee Hachadoorian
Дата:
Сообщение: Current Schema for Functions called within other Functions