zoukankan      html  css  js  c++  java
  • PreparedStatementCallback; SQL [insert into person values(?,?,?)]; ORA-01722: 无效数字

    log4j:WARN No appenders could be found for logger (org.springframework.context.support.ClassPathXmlApplicationContext).
    log4j:WARN Please initialize the log4j system properly.
    here
    Exception in thread "main" org.springframework.dao.DataIntegrityViolationException: PreparedStatementCallback; SQL [insert into person values(?,?,?)]; ORA-01722: 无效数字
    ; nested exception is java.sql.SQLSyntaxErrorException: ORA-01722: 无效数字

    Caused by: java.sql.SQLSyntaxErrorException: ORA-01722: 无效数字

        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)
        at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)
        at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)
        at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)
        at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
        at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(T4CPreparedStatement.java:1008)
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1307)
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
        at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:3530)
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeUpdate(OraclePreparedStatementWrapper.java:1350)
        at org.springframework.jdbc.core.JdbcTemplate$2.doInPreparedStatement(JdbcTemplate.java:745)
        at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:538)
        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:739)
        at org.springframework.jdbc.core.JdbcTemplate.update(JdbcTemplate.java:762)
        at org.springframework.jdbc.object.SqlUpdate.update(SqlUpdate.java:168)
        at com.pb.personDaoImpl.JDBCTemplatePersonDaoImpl.insert(JDBCTemplatePersonDaoImpl.java:35)
        at com.pb.personEntity.test.Test.test1(Test.java:30)
        at com.pb.personEntity.test.Test.main(Test.java:18)
    解决方案:

    image

    如上图,oracle数据库的顺序是p_id,age,name;而我们在dao中的设置参数类型的时候也一定要遵循数据库的顺序。

    insert into person values(?,?,?);参数类型要一致。

  • 相关阅读:
    win查看所有wifi密码
    vsftp配置详解
    python3.7项目打包为一个exe
    ATT&CK实战系列——红队实战(一)
    PHP SECURITY CALENDAR 2017 (Day 9
    python3安装gmpy2
    [CISCN2019 总决赛 Day2 Web1]Easyweb(预期解)
    python2与python3共存及py2IDLE打不开的解决方案
    [BJDCTF 2nd]
    PHP SECURITY CALENDAR 2017 (Day 1
  • 原文地址:https://www.cnblogs.com/yaojiu/p/3522960.html
Copyright © 2011-2022 走看看