"Erik Brown" <er********@gmail.com> wrote in message
news:3c**************************@posting.google.c om...
sql = "CALL " + myschema + ".MYSPROC(?,?,?,?,?,?,?,?,?)";
rs = con.prepareCall(sql);
rs.setString(1, user);
rs.setString(2, action);
rs.setString(3, versions);
rs.setString(4, spec);
rs.setString(5, where);
rs.setString(6, server);
rs.setString(7, flag);
rs.registerOutParameter(8, Types.INTEGER);
rs.registerOutParameter(9, Types.VARCHAR);
I'm trying to call this SP (running on DB2 v7 on z/OS), but I get an
exception saying that index 9 is out of bounds on the last
registerOutParameter() call.
Is it possible that this code breaks a restriction on the number
params that you can pass in? Any other ideas?
I very much doubt that you are breaking the limit on the number of
parameters. I know that the limit was 90 on DB2 V7 for Windows/Linux/Unix so
I doubt the z/OS limit would be lower, especially as low as 8. I've tried
looking for the limit in the V7 z/OS manuals but can't find it despite
checking several manuals and using various search terms; I'm starting to
think that the limit isn't in the manual although that would surprise me.
However, I would be very surprised if the limit was less than 9.
It's very hard to give other suggestions since you have not supplied an
exact error message. The fragment of code you have posted looks OK to me. I
could see this error - or something like it - occurring if the number of
parameter markers in your 'call' statement was 8 or fewer but it looks to me
as if you have 9.
Do you have a debugger? If so, maybe you can step trace your way through the
code, watching carefully, and see if anything unexpected happens *before*
you throw the exception. I just tried stepping through similar code and
didn't see anything very interesting happen but maybe something will jump
out at you.
Also, it might be useful for you to look through some other stored
procedures at your company and verify that 9 parameters is not over the
limit for z/OS; if you've got other stored procedures with 9 or more
parameters running successfully, then you can be certain that isn't the
problem.
Posting your exact Exception and the SQLCode you got may also be useful.
I can't think of anything else at this point.
Rhino