jQuery in Action, 2nd edition*
The moose likes JDBC and the fly likes How can get the return code of a StoreProcedure? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How can get the return code of a StoreProcedure?" Watch "How can get the return code of a StoreProcedure?" New topic
Author

How can get the return code of a StoreProcedure?

Li Shangqiang
Greenhorn

Joined: Mar 25, 2001
Posts: 22
in my store procedures, sometime i return some numbers; but how can i get it? In this case getResultSet() generate a error, getUpdateCount() return -1. My database is SQL Server, and dirver is JDBC-ODBC Bridge
SimplyEd Me
Greenhorn

Joined: Oct 18, 2001
Posts: 1
E.g.
final String sqlCallDEPRejects = "{? = call dep_rejects (?)}";
CallableStatement cstmt = con.prepareCall(sqlCallDEPRejects);
cstmt.registerOutParameter(1,java.sql.Types.INTEGER);
cstmt.setString(2, "2" + " ");
cstmt.execute();
int totalMoved = cstmt.getInt(1);
cstmt.close();
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How can get the return code of a StoreProcedure?