Skip site navigation (1) Skip section navigation (2)

jdbc and refcursor problem

From: "Gaetano Sferra" <gaesferr(at)libero(dot)it>
To: "pgsql-interfaces" <pgsql-interfaces(at)postgresql(dot)org>
Subject: jdbc and refcursor problem
Date: 2004-12-03 14:20:15
Message-ID: I85H5R$ (view raw, whole thread or download thread mbox)
Lists: pgsql-interfaces
Hello to all,
I need to process a cursor returned by a stored function,
reading the jdbc driver docs I learned how to do it but I got a strange behavior
using metadata.
For xample:

CallableStatement cstm = conn.prepareCall("{ ? = call myfunction() }");
cstm.registerOutParameter(1, Types.OTHER);

ResultSet rs = (ResultSet) cstm.getObject(1);
ResutlSetMetaData rsmd = rs.getMetaData();
int columns  = rsmd.getColumnCount() // <-- this throw a NullPointerException

I got a NullPointerException when try to retrieve the ResultSet column count
even if the ResultSet contains or not data. Is there a workaround?

Gaetano Sferra

Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
Abbonati subito su


pgsql-interfaces by date

Next:From: Michael FuhrDate: 2004-12-04 22:18:58
Subject: Re: PL/Python: How do I use result methods?
Previous:From: Michael FuhrDate: 2004-12-03 01:41:15
Subject: Re: libpq: how to get error code (not message)

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group