Getting Reference cursors - Mailing list pgsql-jdbc

From Andrés Luna
Subject Getting Reference cursors
Date
Msg-id 005501c56e08$3aeea800$ab78100a@ifx.local
Whole thread Raw
Responses Re: Getting Reference cursors
List pgsql-jdbc
Hi guys
 
Im using the JDBC driver to connect to a Postgres Database. I have a function that returns a reference cursor and it works ok returning result itself. However, whenever I try to use the result set meta data of the ref cursor it doesn't work. Let me explain better:
// procedure call
CallableStatement proc = con.prepareCall("{ ? = call doquery ( ? ) }");
proc.registerOutParameter(1, Types.Other);
proc.setInt(2, -1);
proc.execute();
ResultSet results = (ResultSet) proc.getObject(1); //this the ref. cursor
ResultSetMetaData rm = results.getMetaData(); //result set meta data of the ref. cursor
System.out.println(rm); //prints the reference of the object so it is not null
int columnCount = rm.getColumnCount() //NullPointerException :(
results.close();
proc.close();
 
The rm object in this code is not null. However, the internall data of it, such as column counts and column names is null. Am I doing something wrong ? Is it possible to obtain the result set meta data from a Reference cursor returned from an function. If not, how do you get the column names ??
 
The driver version im using is : pg74.216.jdbc3.jar
 
Tks in advance for any help !!
 
 
 
ANDRES LUNA TAMAYO
Software Developer
IFX NETWORKS
(571) 3693000
 
***** AVISO DE CONFIDENCIALIDAD ***** 
ESTE MENSAJE, (INCLUYENDO CUALQUIER ANEXO) ESTÁ DIRIGIDO ÚNICAMENTE A LOS DESTINATARIOS ARRIBA SEÑALADOS. PUEDE CONTENER INFORMACIÓN CONFIDENCIAL O PRIVILEGIADA Y NO DEBE SER LEÍDO, COPIADO O DE OTRA FORMA UTILIZADO POR CUALQUIER OTRA PERSONA. SI USTED RECIBE ESTA COMUNICACIÓN POR ERROR, FAVOR AVISAR AL REMITENTE Y ELIMINAR EL MENSAJE DE SU SISTEMA.
 
THIS E-MAIL (INCLUDING ANY ATTACHMENTS) IS INTENDED ONLY FOR THE RECIPIENT(S) NAMED ABOVE. IT MAY CONTAIN CONFIDENTIAL OR PRIVILEGED INFORMATION AND SHOULD NOT BE READ, COPIED OR OTHERWISE USED BY ANY OTHER PERSON. IF YOU ARE NOT A NAMED RECIPIENT, PLEASE CONTACT THE SENDER AND DELETE THE E-MAIL FROM YOUR SYSTEM. 
 
 

--
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.323 / Virus Database: 267.6.6 - Release Date: 08/06/2005

pgsql-jdbc by date:

Previous
From: Manuel Sugawara
Date:
Subject: Re: [pgsql-es-ayuda] 67% of members got laid
Next
From: hubert depesz lubaczewski
Date:
Subject: duration: missing with jdbc for postgresql 8.0