1

When I try to execute stored procedure with spring the this exception is thrown:

    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)

I'm using myfaces 1.2.5, spring 2.0.2

The first argument is Integer and the last is NUMBER. The mapping of the Oracle Types and Java types are as follows:

Integer -> Numeric
NUMBER -> Decimal.

My question is what is the reason of this exception and how to fix it?

Thanks in advance.

2 Answers 2

0

The error originates from LINE 53 of TEST.TEST_PKG

There seems to be an INSERT statement with incorrect binding types.

1
  • The database developer already see that case and say that everything is ok in DB. The strange thing is that it work in Google Chrome but not in IE. May 8, 2013 at 7:06
0

The problem was from the new rows in text inserted in the DB. I just call replacaAll("\n","") and now everything works fine.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.