我正在尝试使用 jdbcTemplate().update 方法删除队列。这是 -
getJdbcTemplate().update("call DBMS_AQADM.DROP_QUEUE_TABLE (?, ?)", qTableName.toUpperCase(),true);
DBMS_AQADM.DROP_QUEUE_TABLE 有两个参数。1) queue_table 作为字符串和 2) force 作为布尔值。
当我尝试运行上面的代码时,我得到 -
PreparedStatementCallback; bad SQL grammar [call DBMS_AQADM.DROP_QUEUE_TABLE (?, ?)]; nested exception is java.sql.SQLException: ORA-06553: PLS-306: wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'
ORA-06553: PLS-306: wrong number or types of arguments in call to 'DROP_QUEUE_TABLE'
但是当我运行以下代码时,它可以正常工作-
getJdbcTemplate().update("call DBMS_AQADM.CREATE_QUEUE_TABLE (?, ?)", qTableName.toUpperCase(), payloadType.toUpperCase());
我猜是,问题是将 oracle 对象(不是 varchar 或 int)作为参数传递。
我真的很想知道有什么办法可以解决这个问题。