当我尝试使用 spring 执行存储过程时,会引发此异常:
Caused by: org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call TEST_PKG.DO_IT(?, ?, ?, ?, ?, ?, ?, ?, ?)}]; SQL state [72000]; error code [1461]; ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at "TEST.TEST_PKG", line 53
ORA-06512: at line 1
; nested exception is java.sql.SQLException: ORA-01461: can bind a LONG value only for insert into a LONG column
ORA-06512: at "TEST.TEST_PKG", line 53
ORA-06512: at line 1
at org.springframework.jdbc.support.SQLStateSQLExceptionTranslator.translate(SQLStateSQLExceptionTranslator.java:124)
at org.springframework.jdbc.support.SQLErrorCodeSQLExceptionTranslator.translate(SQLErrorCodeSQLExceptionTranslator.java:322)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:952)
at org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:985)
at org.springframework.jdbc.object.StoredProcedure.execute(StoredProcedure.java:117)
我正在使用 myfaces 1.2.5,spring 2.0.2
第一个参数是 Integer,最后一个参数是 NUMBER。Oracle 类型和 Java 类型的映射如下:
Integer -> Numeric
NUMBER -> Decimal.
我的问题是这个异常的原因是什么以及如何解决它?
提前致谢。