Subject | Re: [Firebird-Java] stored procedures and Jaybird |
---|---|
Author | Marco Parmeggiani |
Post date | 2003-06-03T07:35:24Z |
On Tue, 3 Jun 2003 09:16:32 +0200, you wrote:
1) call like 'EXECUTE "someProcedure" ... '
you should use CallableStatement in this way:
CallableStatement cs = conn.prepareCall(query);
cs.execute();
rs = cs.getResultSet();
2) call like 'SELECT "bla" FROM "someProcedure"
you should use PreparedStatement in this way:
PreparedStatement ps = conn.prepareCall(query);
rs = ps.executeQuery();
mixing the two things does not work, for example:
PreparedStatement ps = conn.prepareCall(query);
ps.execute();
rs = ps.getResultSet();
won't work. The same for:
CallableStatement cs = conn.prepareCall(query);
rs = cs.executeQuery();
if you follow these rules things work fine.
ciao
--
Seti@Home Java Applets
http://www.mycgiserver.com/~maruko/
>This in the "know bugs" sectioni don't know what that really mean, what i know is this:
>
>
>"3) 631090: Calling stored procedures - cannot be fixed with current
>Firebird implementation."
>
>makes me wonder if stored procedures work or not.. do they work?
>
1) call like 'EXECUTE "someProcedure" ... '
you should use CallableStatement in this way:
CallableStatement cs = conn.prepareCall(query);
cs.execute();
rs = cs.getResultSet();
2) call like 'SELECT "bla" FROM "someProcedure"
you should use PreparedStatement in this way:
PreparedStatement ps = conn.prepareCall(query);
rs = ps.executeQuery();
mixing the two things does not work, for example:
PreparedStatement ps = conn.prepareCall(query);
ps.execute();
rs = ps.getResultSet();
won't work. The same for:
CallableStatement cs = conn.prepareCall(query);
rs = cs.executeQuery();
if you follow these rules things work fine.
ciao
--
Seti@Home Java Applets
http://www.mycgiserver.com/~maruko/