IBM Support

JDBC ERRORCODE -4476 on call to a stored procedure that does not return result set(s) via executeQuery(), using Type 4 connection

Troubleshooting


Problem

JDBC applications using the IBM Data Server Driver for JDBC and SQLJ, and a Type 4 connection, may fail with driver error code -4476 on a call to a stored procedure using the JDBC executeQuery method, while the same application does not fail if a Type 2 (native) connection is used

Symptom

The error message received should be similar to the following:

Exception: com.ibm.db2.jcc.am.SqlException: [jcc][10100][10910][3.64.82] java.sql.CallableStatement.executeQuery() was called but no result set was returned.                                                            
Use java.sql.CallableStatement.executeUpdate() for non-queries.      
ERRORCODE=-4476, SQLSTATE=null  

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Routines (SP \u0026 UDF) - SQL","Platform":[{"code":"PF033","label":"Windows"}],"Version":"9.7;9.5;10.1;10.5","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Log InLog in to view more of this document

This document has the abstract of a technical article that is available to authorized users once you have logged on. Please use Log in button above to access the full document. After log in, if you do not have the right authorization for this document, there will be instructions on what to do next.

Document Information

Modified date:
30 April 2025

UID

swg21601186