ResultSet got NullPointerException on getMetaData calls - Mailing list pgsql-jdbc

From Gaetano Sferra
Subject ResultSet got NullPointerException on getMetaData calls
Date
Msg-id I8ALFT$189578CB5BD118C282FC0B9D1E04A48E@libero.it
Whole thread Raw
Responses Re: ResultSet got NullPointerException on getMetaData calls
List 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



pgsql-jdbc by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: prepared statement call fails
Next
From: "Gaetano Sferra"
Date:
Subject: Re: ResultSet got NullPointerException on getMetaData calls