Subject Re: [Firebird-Java] CallableStatement returning a ResultSet!
Author Roman Rokytskyy
> CallableStatement cs = conn.prepareCall("EXECUTE PROCEDURE
> ResultSet rsc = cs.executeQuery();
> while({
> 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.

If your procedure is selectable, you have to use SELECT * FROM procedure.
EXECUTE PROCEDURE will select only first row. That's Firebird specifics. You
cannot use selectable procedures with EXECUTE PROCEDURE statements.

In your case you should use:

PreparedStatement stmt = con.prepareStatement(
ResultSet rs = stmt.executeQuery();

> CallableStatement cs = conn.prepareCall("?=EXECUTE PROCEDURE

This is completely incorrect. Please either use Firebird syntax or escaped

> cs.registerOutParameter(1, Types.OTHER);

JayBird does not know Types.OTHER.