Subject | Re: CallableStatement |
---|---|
Author | rrokytskyy |
Post date | 2002-05-25T09:55:24Z |
> I have a question about CallableStatement in JDBC Driver.This is bug in driver, but I have no idea how to correct it. When you
> There is the stored procedure with 2 in parameters and 2 out
> parameters (RETURNS ...).
> What should I write in connection.prepareCall() method?
> I use connection.prepareCall("{call sp_procedure (?,?,?,?)}") and
> get SQLException with message:
> "GDSException: org.firebirdsql.gds.GDSException: Dynamic SQL Error
> parameter mismatch for procedure SP_PROCEDURE"
>
> What is wrong?
issue this procedure call, at this time driver has no information
about what parameter is in and what is out. Driver transforms {call
sp_procedure(?,?,?,?)} into EXECUTE PROCEDURE sp_procedure(?,?,?,?),
which is incorrect because you have only 2 in params.
So, you have to use {call sp_procedure(?,?)} and set values only for
in parameters, and then access out params using getXXX methods.
> P.S. Is there the documentation for JDBC DriverNo.
Best regards,
Roman Rokytskyy