DB2 Stored Procedure
104297May 4 2006 — edited May 4 2006We are trying to call a DB2 Stored Procedure which takes one input parameter and opens a cursor. This is the code which we are trying to use.
StoredProcedureCall procedure = new StoredProcedureCall() ;
procedure.setProcedureName("PXYPROC.PIMSPT7") ;
procedure.addUnamedArgumentValue("P") ;
cs.executeSelectingCall(procedure) ;
If the procedure does not have any input parameter and all are out parameter or there are no parameters at all, the code works without any problem. But if it has an input parameter its throwing exception. Also, we created a simple JDBC way(using callable statements) of calling this SP with one input parameter, there are no issues, the code works without any issues. Did any one face this ?
Whenever this code is executed we get the following exception.
Local Exception Stack:
Exception [TOPLINK-4002] (OracleAS TopLink - 10g (9.0.4.4) (Build 040627)): oracle.toplink.exceptions.DatabaseException
Exception Description: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0440N No authorized routine named "PIMSPT7" of type "" having compatible arguments was found. SQLSTATE=42884
Internal Exception: COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver][DB2] SQL0440N No authorized routine named "PIMSPT7" of type "" having compatible arguments was found. SQLSTATE=42884
Error Code: -440
at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:227)
at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:697)
at oracle.toplink.threetier.ServerSession.executeCall(ServerSession.java:506)
at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:134)
at oracle.toplink.internal.queryframework.CallQueryMechanism.executeCall(CallQueryMechanism.java:115)
at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelectCall(CallQueryMechanism.java:197)
at oracle.toplink.internal.queryframework.CallQueryMechanism.executeSelect(CallQueryMechanism.java:178)
at oracle.toplink.queryframework.DataReadQuery.executeNonCursor(DataReadQuery.java:80)
at oracle.toplink.queryframework.DataReadQuery.execute(DataReadQuery.java:73)
at oracle.toplink.queryframework.DatabaseQuery.execute(DatabaseQuery.java:493)
at oracle.toplink.queryframework.ReadQuery.execute(ReadQuery.java:125)
at oracle.toplink.publicinterface.Session.internalExecuteQuery(Session.java:1958)
at oracle.toplink.threetier.ServerSession.internalExecuteQuery(ServerSession.java:629)
at oracle.toplink.threetier.ClientSession.internalExecuteQuery(ClientSession.java:392)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1086)
at oracle.toplink.publicinterface.Session.executeQuery(Session.java:1038)
at oracle.toplink.publicinterface.Session.executeSelectingCall(Session.java:1136)
at misc.CheckDB2Connect.checkProcedure7(CheckDB2Connect.java:283)
at misc.CheckDB2Connect.main(CheckDB2Connect.java:38)