zoukankan      html  css  js  c++  java
  • 操作MyBatis引发Error setting null for parameter #X with JdbcType OTHER .无效的列类型

    再用MyBatis操作Oracle的时候,传入null值而引发的错误

    异常信息:

    org.springframework.jdbc.UncategorizedSQLException: Error setting null for parameter #6 with JdbcType OTHER .
     Try setting a different JdbcType for this parameter or a different jdbcTypeForNull configuration property. Cause: 
     java.sql.SQLException: 无效的列类型 ; 
     uncategorized SQLException for SQL []; SQL state [null]; error code [17004];
     无效的列类型; nested exception is java.sql.SQLException: 无效的列类型

    我们用MyBatis操作数据库的时候传入null值,而且没有加入jdbcType类型的时候就会引发上述这种错误类型,

    因为MyBatis不知道这个地方要传入什么什么参数

    解决方案:

    1.单个配置

    直接在后面加上 jdbcType=类型
    #{id,jdbcType=VARCHAR}
  • 相关阅读:
    codeforces 980A Links and Pearls
    zoj 3640 Help Me Escape
    sgu 495 Kids and Prizes
    poj 3071 Football
    hdu 3853 LOOPS
    hdu 4035 Maze
    hdu 4405 Aeroplane chess
    poj 2096 Collecting Bugs
    scu 4444 Travel
    zoj 3870 Team Formation
  • 原文地址:https://www.cnblogs.com/itzfz/p/15073328.html
Copyright © 2011-2022 走看看