Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2013-02-05 이후 메이저 토토 사이트 15:29 |
---|
From: | mtsahakis at gmail(dot)com (Manos Tsahakis) |
---|---|
To: | |
Subject: | [Pljava-dev] Cannot obtain java.sql.Array from java.sql.ResultSet getArray() method call |
Date: | 2013-02-05 15:29:06 |
Message-ID: | CABuvXqo+UGkUNMbx7wdVxaRCA=uhU9yii5V=h6mmmAx-gPFfpA@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | PostgreSQL : PostgreSQL 메일 링리스트 : 2013-02-05 이후 메이저 토토 사이트 15:29 |
Hello all,
We are currently experimenting on our development environment with pl/java
and thinking of using postgres functions from already existing static java
methods.
We encountered a problem when trying to retrieve data stored as smallint[]
on a postgres table:
Cannot derive a value of class java.sql.Array from an object of class
[Ljava.lang.Short;
java.sql.SQLException: Cannot derive a value of class java.sql.Array from
an object of class [Ljava.lang.Short;
This occurs in line:
java.sql.Array SQLsched = rs.getArray(2);
The workaround is straightforward enough, we can change the above java code
line to:
Short[] work = (Short[])rs.getObject(2);
and alter a bit our flow so as to facilitate this change. However, we are
concerned about memory, given the overhead of a java array of Objects vs.
that of a java primitive array.
Is there another, more efficient workaround than the one I mention above?
Does pl/java implement a specific jdbc specification, and if yes, then
which?
My development environment:
ubuntu 12.04
PostgreSQL 9.0.10 on x86_64-unknown-linux-gnu, compiled by GCC gcc
(Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit
pljava-snapshot.20120525.0
Many thanks in advance,
Manos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pgfoundry.org/pipermail/pljava-dev/attachments/20130205/f02514f5/attachment.html>