This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes JDBC and Relational Databases and the fly likes Exception calling Stored Procedure Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
Bookmark "Exception calling Stored Procedure" Watch "Exception calling Stored Procedure" New topic

Exception calling Stored Procedure

gokul maha

Joined: Jun 27, 2006
Posts: 25

I have the below code to execute a DB2 SP.

String spName = "ABC.PQR(?,?,?,?,?,?)";
String sql = "{Call " + spName+ "}";
CallableStatement cStmt = con.prepareCall(sql);

cStmt.setBinaryStream(1,inputStream, inputStreamAvailable);
cStmt.setBinaryStream(2,inputStream1, inputStreamAvailable1);

When running the SP from applciation, it is giving below exception at execute. DB2 SQL error: SQLCODE: -440, SQLSTATE: 42884, SQLERRMC: ABC.PQR;PROCEDURE

ABC - Schema name
PQR - SP name
Please help me regarding this.

Thanks in advance.
Matt Dudbridge

Joined: Nov 22, 2006
Posts: 2

The SQLState code (42884) would imply that the arguments you are passing are incompatible with your stored proc or DB2:

"No authorized routine named '<routineName>' of type '<type>' having compatible arguments was found."

A handy reference for SQLStates can be found at .


Matt Dudbridge<br /><a href="" target="_blank" rel="nofollow"></a>
I agree. Here's the link:
subject: Exception calling Stored Procedure
It's not a secret anymore!