This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes JDBC and the fly likes CLI0112E  Error in assignment. SQLSTATE=22005 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "CLI0112E  Error in assignment. SQLSTATE=22005" Watch "CLI0112E  Error in assignment. SQLSTATE=22005" New topic
Author

CLI0112E Error in assignment. SQLSTATE=22005

vikram nalagampalli
Ranch Hand

Joined: Oct 08, 2001
Posts: 91
Hi all,
I trying to call a stored procdure and i am getting the above mentioned error.
I am enclosing both code and the error, pls let me know what could have been the problem. I am really going crazy with this.
public MessageList retrieveMessageList(PortalID portalID) throws PortalIDNotFoundException {

String portalUserID = portalID.getPortalID();
String groupList = "1,2";

try {
String procName = "IDS.RETRIEVE_MESSAGE_LIST";
String sql = "CALL " + procName + "(?,?,?,?)";

System.out.println("sql = " + sql);

CallableStatement callableStmt = getConnection().prepareCall(sql);
// set the input parameters
callableStmt.setString(1, portalUserID);
callableStmt.setString(2, groupList);
// register the output parameters
callableStmt.registerOutParameter(3, Types.CHAR); // exception type
callableStmt.registerOutParameter(4, Types.CHAR); // exception text
System.out.println("Calling stored procedure...");
callableStmt.execute();
System.out.println("done with execute()");
// retrieve the output parameters
String exceptionType = callableStmt.getString(3).trim();
String exceptionText = callableStmt.getString(4).trim();
System.out.println("exceptionType = " + exceptionType);
System.out.println("exceptionText = " + exceptionText);
} catch (SQLException sqle) {
sqle.printStackTrace();
}

ERROR
COM.ibm.db2.jdbc.DB2Exception: [IBM][CLI Driver] CLI0112E Error in assignment. SQLSTATE=22005
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:260)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.throw_SQLException(SQLExceptionGenerator.java:197)
at COM.ibm.db2.jdbc.app.SQLExceptionGenerator.check_return_code(SQLExceptionGenerator.java:448)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute2(DB2PreparedStatement.java:1247)
at COM.ibm.db2.jdbc.app.DB2PreparedStatement.execute(DB2PreparedStatement.java:2389)
at com.ghp.ids.impl.IDSFacadeImpl.retrieveMessageList(IDSFacadeImpl.java:252)
at com.ghp.ids.impl.IDSFacadeTester.testRetrieveMessageList(IDSFacadeTester.java:25)
at com.ghp.ids.impl.IDSFacadeTester.main(IDSFacadeTester.java:18)
Piyush Daiya
Ranch Hand

Joined: Jun 13, 2002
Posts: 67
Hi,

Try changing the lines
// register the output parameters
callableStmt.registerOutParameter(3, Types.CHAR); // exception type
callableStmt.registerOutParameter(4, Types.CHAR); // exception text

to
// register the output parameters
callableStmt.registerOutParameter(3, Types.VARCHAR); // exception type
callableStmt.registerOutParameter(4, Types.VARCHAR); // exception text

HTH,
Piyush


"A scientist is not person who gives right answers but a person who asks right questions"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: CLI0112E Error in assignment. SQLSTATE=22005