aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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?
 
Similar Threads
JVMIT IterateOverInstancesOfClass
Getting an index from a parser
Help with returning one string from three methods of type string?
Session Advice
how to capture http request and force return response