Subject Re: Please help - CallableStatement only returning first row of ResultSet
Author roddiwalker
Actually I had to use:

((FirebirdCallableStatement)stmt).setSelectableProcedure(true);

But thanks Roman, this works like a charm.
I guess the proc type needs to be set before adding its parameters -
otherwise it could be set implicitly by stmt.executeQuery().

Thanks again,
Roddi

--- In Firebird-Java@yahoogroups.com, Roman Rokytskyy <rrokytskyy@...>
wrote:
>
>
DriverManager.getConnection("jdbc:firebirdsql:localhost/3050:D:\\Programs\\Firebird\\examples\\empbuild\\employee.fdb",
> > "sysdba", "masterkey");
> > CallableStatement stmt = conn.prepareCall("{call foo(?)}");
>
> Add the following call here:
>
> ((FirebirdCallableStatement)stmt).setSelectable(true);
>
> > stmt.setString(1, "Germany");
> > ResultSet rs = stmt.executeQuery();
> > while (rs.next())
> > System.out.println(rs.getString(1));
> > conn.close();
> >
> > What am I doing wrong?
> > I am running FB 2.0.1, jaybird-full-2.1.1.jar, JDK 1.5.04 on Win
XP Pro.
>
> The issue is that Jaybird has no idea whether the procedure is
> selectable or executable when it is specified in the escaped syntax.
> System tables also do not provide such information. So, it uses EXECUTE
> PROCEDURE by default. For selectable procedures developer has to
provide
> a hint to Jaybird to use SELECT ... FROM call instead.
>
> Roman
>