Help Call Stored Procedure

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Help Call Stored Procedure

I am using HSQL as in-memory db for unit testing SQL server stored procedure
(SP). Implementation is in Java using JDBC as below:

conn.prepareCall("{?=call spName (?)}");
stmt.registerOutParameter(1, Types.INTEGER);
stmt.setInt(2, contract.getACESMemberId());

Above Java lines invoke SP deployed on sql server db. As you see there is
one procedure parameter and one return value. SP defn in sql server will be
something like - spName(integer p1).

When i mimic spName in HSQLDB with just one input parameter, then
registerOutParameter line (above) fails. When I define HSQLDB SP with 2
parameters one OUT and other IN then I get "user object not found" because
spName in sql server accepts 1 parameter where-as one in HSQLDB accepts two

Whether I try alias or plan SQL stored procedure or Java stored procedure, I
am stuck at same above behavior.

It seems "?=call" behavior is diff for HSQLDB JDBC driver than other DB
drivers (SQL server or Oracle that I know).

Appreciate if forum provide can some directions.
Changing existing code for unit testing is not a viable option as that will
involve large testing cycle.


Hsqldb-user mailing list
[hidden email]