Ver Mensaje Individual
  #2 (permalink)  
Antiguo 02/06/2007, 23:09
highwayman
 
Fecha de Ingreso: junio-2007
Mensajes: 4
Antigüedad: 16 años, 11 meses
Puntos: 0
Re: Problemas con JDBC

Lo que tengo es esta funcion:

CREATE FUNCTION _getdatos_persona_cursor (id1 integer, id2 integer) RETURNS SETOF refcursor AS
declare
ref1 refcursor;
ref2 refcursor;

begin

open ref1 for select * from persona where persona.id = $1;
return next ref1;

open ref2 for select * from persona where persona.id = $2;
return next ref2;
return;
end

Ahora en la aplicacion java cuando quiero obtener los valores de ref1 y ref2 y lo que me retorna es:
org.postgresql.jdbc3.Jdbc3ResultSet@125844f
org.postgresql.jdbc3.Jdbc3ResultSet@49d67c


CrearConeccion();
con.setAutoCommit(false);

pst = con.prepareStatement("Select * from _getdatos_persona_cursor(?,?)", ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);

pst.setObject(1, id1);
pst.setObject(2, id2);
pst.execute();
rs = pst.getResultSet();
while(rs.next()){
System.out.println(rs.getObject(1));
}
CerrarConeccion();

Me pudieran decir que hago mal aqui.....