java call oracle procudure setBoolean问题PLS-00306: wrong number or types of arguments in call to

来源:互联网 发布:js 获取元素父节点 编辑:程序博客网 时间:2024/05/02 04:52

http://www.itpub.net/forum.php?mod=viewthread&action=printable&tid=1186364

java代码如下 可能是不能传递boolean型参数所致,大家有什么好方法没有?谢谢

try {
    clstmt = conn.prepareCall("{? = call my_test(?,?,?)}");
    clstmt.registerOutParameter(1, Types.VARCHAR);
    clstmt.setString(2, "1111111");
    clstmt.setBoolean(3, false);
    clstmt.registerOutParameter(4, Types.VARCHAR);
    clstmt.execute();
} catch (SQLException e) {
    System.out.println(e.getMessage());
}




java.sql.SQLException: ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'IU_DELTA_STAGE_CLEANUP'
ORA-06550: line 1, column 7:
PLS-00306: wrong number or types of arguments in call to 'IU_DELTA_STAGE_CLEANUP'
ORA-06550: line 1, column 7:
PL/SQL: Statement ignored

        at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:331)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:288)
        at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:743)
        at oracle.jdbc.driver.T4CCallableStatement.doOall8(T4CCallableStatement.java:212)
        at oracle.jdbc.driver.T4CCallableStatement.executeForRows(T4CCallableStatement.java:951)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1160)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3285)
        at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:3390)
        at oracle.jdbc.driver.OracleCallableStatement.execute(OracleCallableStatement.java:4223)
        at pkg_test.main(pkg_test.java:31)

 

 

=====================

oracle 最后会把true翻译成1,false 翻译成0, 都是number类型

原创粉丝点击