Oracle SQL State [99999]; Error code [17026]; Digital overflow

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.