Hi all,
Here is the DAO to call SP.
1) After doing a preparecall i am setting input parameter.
callableStatement.setString(FUNCTION_CODE, " ");
But i am getting the below Exception in the above setString Statement.
----------
Exception:
----------
com.ibm.db2.jcc.b.SqlException:
JDBC 3 method called - not yet supported
at com.ibm.db2.jcc.b.bd.setString(bd.java:961)
at org.apache.commons.dbcp.DelegatingCallableStatement.setString
(DelegatingCallableStatement.java:221)
Please help me in this regard.
Version:
--------
Hibernate 3.0
DB2 Version 8.1.6.4
DAO CODE:
-----------
try {
session = HibernateUtil.getInstance(CONFIG_FILE_LOCATION).getCurrentSession();
getIndexTrans = session.beginTransaction();
try {
CallableStatement callableStatement = session.connection().prepareCall("{call DB2IAA1.SP0044(?,?,?,?,?)}");
callableStatement.setString(FUNCTION_CODE, " ");
callableStatement.setString(LOGCL_RUN_DTE, emptyString(NUMBER_TEN));
callableStatement.setString(SCHD_CMPNT_CDE, emptyString(1));
callableStatement.setString(ENV_TYPE_CDE, emptyString(1));
callableStatement.setString(USER_ID, emptyString(NUMBER_EIGHT));
callableStatement.setString(I_FUNCTION_CODE, FUNC_CODE_UPDATE);
callableStatement.setLong(I_DOCUMENT_TYPE, usageParams.getDocumentId());
callableStatement.setString(I_CASE_ID, usageParams.getCaseId());
callableStatement.setString(I_LOB_SYSTEM_TYPE, "VALUE FROM CVT");
callableStatement.setString(I_DOCUMENT_TYPE, usageParams.getDocumentUsageContextType());
callableStatement.setString(I_NEW_DOC_TYPE, emptyString(2));
callableStatement.setString(I_ACF_ID, emptyString(NUMBER_SEVEN));
callableStatement.setString(I_CASE_SUBJECT_TYP, assignStringValue(usageParams.getCaseSubjectType(), 2));
callableStatement.setString(I_CASE_SUBJECT_VAL, assignStringValue(usageParams.getCaseSubjectValue(), LENGTH_TWENTY_THREE));
callableStatement.setString(I_BSNS_PROC_TYPE, assignStringValue(usageParams.getBusinessProcessType(), NUMBER_FOUR));
callableStatement.setString(I_NEW_BSNS_PROC_TP, emptyString(NUMBER_FOUR));
callableStatement.registerOutParameter(RETURNED_RES_SETS, Types.SMALLINT);
callableStatement.registerOutParameter(RESULT_INFO_BLK, Types.CHAR);
callableStatement.registerOutParameter(RETURN_CODE, Types.SMALLINT);
callableStatement.registerOutParameter(RETURN_MSG_NUM, Types.SMALLINT);
callableStatement.registerOutParameter(ERROR_INTERFACE, Types.CHAR);
callableStatement.execute();
callableStatement.getInt(RETURNED_RES_SETS);
callableStatement.getString(RESULT_INFO_BLK);
returnCode = callableStatement.getInt(RETURN_CODE);
raiseReturnException(returnCode, methodName);
callableStatement.getInt(RETURNED_RES_SETS);
callableStatement.getString(ERROR_INTERFACE);
}
catch (SQLException e) {
Log.debug(e, "Started printStackTrace");
e.printStackTrace();
Log.debug(e.getLocalizedMessage(), "");
System.out.println(e.getErrorCode());
Log.debug(e, "End printStackTrace");
}
getIndexTrans.commit();
}
catch (HibernateException he) {
if (getIndexTrans != null && getIndexTrans.isActive()) {
if (session != null && session.isConnected()) {
getIndexTrans.rollback();
}
}
/*
* Only raise an alert for a - Check for Error Code = -1,041
*/
if (he.getCause() != null) {
alertDBConnectionFailure(he);
}
raiseException(methodName, he, OACR_HIBERNATE_EXCEPTION);
}
[ August 08, 2006: Message edited by: jacob selvaraj ]