This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JDBC 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 Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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
Similar Threads
Calling Stored Procedure from Spring StoredProcedure throws Exception
stored procedure giving me sql error
Confused by stored procedure sql error
Confused by Stored Procedure Error
Problem: Spring - Stored Procedure call