pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrés Luna <aluna@ifxcorp.com>
To: pgsql-jdbc@postgresql.org
Subject: Getting Reference cursors
Date: Fri, 10 Jun 2005 17:03:26 -0500
Message-ID: <005501c56e08$3aeea800$ab78100a@ifx.local> (raw)

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
HYPERLINK "http://www.ifxnetworks.com/"www.ifxnetworks.com
(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
 

view thread (4+ messages)  latest in thread

Message-ID: <005501c56e08$3aeea800$ab78100a@ifx.local>
Permalink:  ../005501c56e08$3aeea800$ab78100a@ifx.local/
Also on:    postgresql.org/message-id/005501c56e08$3aeea800$ab78100a@ifx.local

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: aluna@ifxcorp.com
  Subject: Re: Getting Reference cursors
  In-Reply-To: <005501c56e08$3aeea800$ab78100a@ifx.local>
  References: <005501c56e08$3aeea800$ab78100a@ifx.local>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox