mybatis 無效的列類型,mybatis無效

來源:互聯網
上載者:User

mybatis 無效的列類型,mybatis無效

項目報錯為:
[FaultEvent fault=[RPC Fault faultString="org.springframework.jdbc.UncategorizedSQLException : Error setting null parameter.  Most JDBC drivers require that the JdbcType must be specified for all nullable parameters. Cause: java.sql.SQLException: 無效的列類型; uncategorized SQLException for SQL []; SQL state [null]; error code [17004]; 無效的列類型; nested exception is java.sql.SQLException: 無效的列類型" faultCode="Server.Processing" faultDetail="null"] messageId="406BB9C8-A70D-B31C-65E7-573E4B6DDBB4" type="fault" bubbles=false cancelable=true eventPhase=2]


XML檔案updateSQL語句為:


實體類對應的屬性設定為:


原因:

MyBatis 插入空值時,需要指定JdbcType 
mybatis insert空值報空值異常,但是在pl/sql不會提示錯誤,主要原因是mybatis無法進行轉換


XML檔案中SQL語句改為:


相關文章

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.