当前位置:我的异常网» Java Web开发 » JAVA调用ORACLE存储过程报错
JAVA调用ORACLE存储过程报错
www.myexceptions.net 网友分享于:2015-07-12 浏览:0次
JAVA调用ORACLE存储过程出错
public void unpack(String pc,String xqdm)throws SQLException {
Session session = getHibernateTemplate().getSessionFactory().getCurrentSession();
Connection conn = session.connection();
//CallableStatement cstmt = null;
try {
CallableStatement cstmt = conn.prepareCall("{Call PKG_I_DFXM.PRC_I_NBBPCF(?,?,?,?,?)");
cstmt.setString(1, pc);
cstmt.setString(2, xqdm);
cstmt.setString(3, "n");
cstmt.registerOutParameter(4, OracleTypes.NUMBER);
cstmt.registerOutParameter(5, OracleTypes.VARCHAR);
cstmt.execute();
//int xcode = cstmt.getInt(4);
//String errormsg = cstmt.getString(5);
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
错误代码
java.sql.SQLException: An SQLException was provoked by the following failure: java.lang.StringIndexOutOfBoundsException: String index out of range: 40
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:106)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:65)
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:62)
at com.mchange.v2.c3p0.impl.NewPooledConnection.handleThrowable(NewPooledConnection.java:432)
at com.mchange.v2.c3p0.impl.NewProxyCallableStatement.execute(NewProxyCallableStatement.java:3058)
at com.qymgr.report.dao.BPUnPackDao.unpack(BPUnPackDao.java:33)
at com.qymgr.report.manager.impl.BPUnpackMngImpl.unPack(BPUnpackMngImpl.java:18)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:318)