java 调用存储过程 无效的列索引_JAVA 调用存储过程报错 java.sql.SQLException: 无效的列索引...

报错信息java.sql.SQLException:无效的列索引atoracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:125)我的代码报错在这里atc...

报错信息

java.sql.SQLException: 无效的列索引

at oracle.jdbc.driver.OracleCallableStatement.registerOutParameterInternal(OracleCallableStatement.java:125)

我的代码报错在这里

at com.sino.base.db.procedure.SQLStoreProcedure.execProcedure(SQLStoreProcedure.java:72)

at com.sino.ies.basedefine.project.plan.dao.ProjectPlanDao.searchdetailplanQTYData(ProjectPlanDao.java:839)

以下为我的方法的代码

public void searchdetailplanQTYData(HttpServletRequest req, String[] detailParam) throws Exception {

// TODO Auto-generated method stub

String sqlProcedure = "BEGIN IES_ITEM_PLAN_AVABLE_QTY.AVAILABLE_PLAN_CURSOR_NEW(?,?,?,?) ; END;";

try {

SQLProcedureParameterList paraList = new SQLProcedureParameterList();

paraList.setParameter(SQLProcedureParameter.STRING, "P_PRODUCT_ID",

detailParam[0], SQLProcedureParameter.IN);

paraList.setParameter(SQLProcedureParameter.INTEGER,

"P_PROJECT_ID", detailParam[1],

SQLProcedureParameter.IN);

paraList.setParameter(SQLProcedureParameter.INTEGER, "P_ORGAN_ID",

detailParam[2],

SQLProcedureParameter.IN);

paraList.setParameter(SQLProcedureParameter.STRING,

"P_BEGIN_DATE", detailParam[3], SQLProcedureParameter.IN);

paraList.setParameter(SQLProcedureParameter.OBJECT, "P_IMP_MSG_INFO",

null, SQLProcedureParameter.OUT);

paraList.setParameter(SQLProcedureParameter.INTEGER, "P_MSG_CODE",

null, SQLProcedureParameter.OUT);

paraList.setParameter(SQLProcedureParameter.STRING, "P_MSG_INFO",

null, SQLProcedureParameter.OUT);

SQLStoreProcedure proc = new SQLStoreProcedure();

proc.setConnection(conn);

proc.execProcedure(sqlProcedure, paraList, null);

RowSet rowSet = proc.getCursorRowSet("P_IMP_MSG_INFO");

req.setAttribute(QueryConstant.SPLIT_DATA_VIEW, rowSet);

} finally {

}

}

已经找到原因了,因为占位符写少了,我只写了进的参数的占位符,没写出的占位符,所以报错,第一次写这个,实在蛋疼,谢谢大家了。

展开

你可能感兴趣的:(java,调用存储过程,无效的列索引)