| 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$B4CD2326C7906242A84B9060C3AF1DBB@libero.it | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| 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);
cstm.execute();
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?
Thanks,
Gaetano Sferra
____________________________________________________________
Libero ADSL: 3 mesi gratis e navighi a 1.2 Mega, senza costi di attivazione.
Abbonati subito su http://www.libero.it
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Michael Fuhr | 2004-12-04 22:18:58 | Re: PL/Python: How do I use result methods? | 
| Previous Message | Michael Fuhr | 2004-12-03 01:41:15 | Re: libpq: how to get error code (not message) |