ResultSet got NullPointerException on getMetaData calls

From: "Gaetano Sferra" <gaesferr(at)libero(dot)it>
To: "pgsql-jdbc" <pgsql-jdbc(at)postgresql(dot)org>
Subject: ResultSet got NullPointerException on getMetaData calls
Date: 2004-12-06 08:40:41
Message-ID: I8ALFT$189578CB5BD118C282FC0B9D1E04A48E@libero.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Hello to all,
I got a NullPointerException when try to call getMetaData method on a refcursor
mapped on a ResultSet.
This is an example scenario:

create table mytable(name varchar, surname varchar, email varchar);
create or replace function myfunction() returns refcursor as'
declare
rc refcursor;
begin
open rc for select * from mytable order by surname;
return rc;
end;

This is a piece of code using the above stored function:

conn.setAutoCommit(false);
CallableStatement proc = conn.prepareCall("{ ? = call myfunction() }");
proc.registerOutParameter(1, Types.OTHER);
proc.execute();
ResultSet rs = (ResultSet) proc.getObject(1);
ResultSetMetaData rsmd = rs.getMetaData(); // <- NullPointerException

I'm using the PostgreSQL 7.4 server and the PostgreSQL JDBC 7.4 drivers.
Reading a previous post by Tomas on this ML I've tried to use the PostgreSQL
JDBC 8.0 driver without succes, the exception stills here.

Thank you for support,
Gaetano Sferra

____________________________________________________________
Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
Abbonati subito su http://www.libero.it

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Gaetano Sferra 2004-12-06 08:47:40 Re: ResultSet got NullPointerException on getMetaData calls
Previous Message Andrew M 2004-12-06 01:48:05 Re: SSL confirmation