Subject | RE: [Firebird-Java] CallableStatement returning a ResultSet! |
---|---|
Author | Rick DeBay |
Post date | 2004-12-03T14:41:35Z |
Can you post your stored procedure?
-----Original Message-----
From: MIHAI_HL [mailto:mihai_hl@...]
Sent: Friday, December 03, 2004 4:10 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] CallableStatement returning a ResultSet!
Hello,
I have a problem when I am executing a stored procedure which return a
ResultSet.
My code looks like this:
CallableStatement cs = conn.prepareCall("EXECUTE PROCEDURE
TEST_RS_RETURN()");
ResultSet rsc = cs.executeQuery();
while(rsc.next()){
System.err.println(rsc.getString(1));
}
The procedure must return a result set containing 3 records. But the
returning result set containts only one record. Can you please tell me
if is something wrong with my code? or what is the reason the
ResultSet object containts only one record.
Also I have tried the following code:
CallableStatement cs = conn.prepareCall("?=EXECUTE PROCEDURE
TEST_RS_RETURN()");
cs.registerOutParameter(1, Types.OTHER);
cs.execute();
ResultSet rsc = (ResultSet)cs.getObject(1);
...
but the following exception is thrown :
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
Thanks
Yahoo! Groups Links
-----Original Message-----
From: MIHAI_HL [mailto:mihai_hl@...]
Sent: Friday, December 03, 2004 4:10 AM
To: Firebird-Java@yahoogroups.com
Subject: [Firebird-Java] CallableStatement returning a ResultSet!
Hello,
I have a problem when I am executing a stored procedure which return a
ResultSet.
My code looks like this:
CallableStatement cs = conn.prepareCall("EXECUTE PROCEDURE
TEST_RS_RETURN()");
ResultSet rsc = cs.executeQuery();
while(rsc.next()){
System.err.println(rsc.getString(1));
}
The procedure must return a result set containing 3 records. But the
returning result set containts only one record. Can you please tell me
if is something wrong with my code? or what is the reason the
ResultSet object containts only one record.
Also I have tried the following code:
CallableStatement cs = conn.prepareCall("?=EXECUTE PROCEDURE
TEST_RS_RETURN()");
cs.registerOutParameter(1, Types.OTHER);
cs.execute();
ResultSet rsc = (ResultSet)cs.getObject(1);
...
but the following exception is thrown :
org.firebirdsql.jdbc.field.TypeConvertionException: Error converting
to object.
Thanks
Yahoo! Groups Links