org.springframework.jdbc.UncategorizedSQLException:CallableStatementCallback; Uncategorized SQLException for SQL [{call UpdateUser (?,?,?,?,?,?)}]; SQL state [99999]; Error code [17026]; Digital overflow;
Create a background:
Oracle database Upgrade from 11g to 12c calling stored procedure Code is used in spring StoredProcedure program has set stored procedure parameter type
New Sqloutparameter ("UserId", Types.
INTEGER)
Create or Replace procedure UpdateUser (userId in int ...) as ...
at the time of execution, the database driver converts the parameter type and the number of stored procedure parameters to report the error.
reason: I used the old version of Spring'sStoredProcedure could be a bug. He will you pass the parameter type to change, and finally not an integer to int, is a long to int, so that the 12c drive when the turn will be error.
Workaround:Method One,put
Types.Replace
INTEGER withTypes.
NUMERIC This may be solved on 12c, do not know and incompatible with the low version, did not try.
method Two, the writing of the process of changing the stored number
JT. Execute (
new connectioncallback () {
Public
Object doinconnection (Connection Connection)
throws SQLException, DATAACC essexception {CallableStatement st =
null;St=connection.preparecall ("{call UpdateUser (?,?,?,?,?)}");St.registeroutparameter (1,types.
INTEGER);St.registeroutparameter (4,types.
INTEGER);St.registeroutparameter (5,types.
VARCHAR);St.setint (1,0);St.setint (2,INSID);St.setint (3,1);St.setint (4,1);st.setstring (5,"OK");St.execute ();codename C =
New codename ();C.setcode ("" + st.getint (4));C.setname (st.getstring (5));
return C; } });
Oracle SQL State [99999]; Error code [17026]; Digital overflow