Re: Retrieving Stored Procedure Returns
From: Bryce (spamtrap_at_berzerker-soft.com)
Date: 09/10/04
- Next message: Alex Hunsley: "Re: Overiding protected methods"
- Previous message: Martin Meier: "opaque - Bedeutung ?"
- In reply to: Xeth Waxman: "Retrieving Stored Procedure Returns"
- Next in thread: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Reply: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Reply: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Fri, 10 Sep 2004 10:35:34 -0400
On 9 Sep 2004 16:01:53 -0700, "Xeth Waxman" <xwaxman@gmail.com>
wrote:
>Greetings experts. I'm having a problem retrieving values from a
>CallableStatement after executing a Stored procedure. The RDBMS is MS
>SQL Server 2k and the JDBC driver is JTDS 0.8.1. Here's the code I
>have:
>
>
should this be:
cs = con.prepareCall("{? = call spGetNextBatch(?,?,?,?,?,?,?,?,?)}");
the name spGetNextBatch makes the think there's an actual return value
with this stored procedure...
>cs.registerOutParameter(7, Types.INTEGER);
>cs.registerOutParameter(8, Types.INTEGER);
>cs.registerOutParameter(9, Types.INTEGER);
>cs.setString(1, "GCC");
>cs.setInt(2, 8);
>cs.setInt(3, 802);
>cs.setString(4, userName);
>cs.setString(5, batchComment);
>cs.setString(6, todayString);
>
>//everything's set - execute
>cs.execute();
>
>while (cs.getMoreResults() == true && cs.getUpdateCount()!= -1)
>{
>//processing stuff
>System.out.println("sizzling shizzle");
>}
>
>//get our values out
>int batchKey = cs.getInt(7);
>int nextBatchNo = cs.getInt(8);
>int retVal = cs.getInt(9);
>
>According to the profiler, the SP is executing and returning the
>appropriate values. However, after running this code, all three value
>(batchKey, nextBatchNo , and retVal) are all unitialized (0), which is
>incorrect. I am stumped as to what I should be looking for or fixing,
>and as always any assistance is appreciated.
-- now with more cowbell
- Next message: Alex Hunsley: "Re: Overiding protected methods"
- Previous message: Martin Meier: "opaque - Bedeutung ?"
- In reply to: Xeth Waxman: "Retrieving Stored Procedure Returns"
- Next in thread: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Reply: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Reply: Xeth Waxman: "Re: Retrieving Stored Procedure Returns"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|