Mybatis On Oracle注意点


Mybatis 在Oracle中的坑

null

mybatis null 的类型默认是OTHER 在oracle中不支持

解决办法:

​ 1。 在#{} 中显示指定jdbc类型 #{name,jdbcType=NULL}

​ 2。修改mybatis的全局配置文件设置jdbcTypeForNull属性为NULL

​ 以下是官方文档中的说明

解释:Specifies the JDBC
 type for null values
 when no specific JDBC type was provided for
 the parameter. Some drivers require specifying the column JDBC type but others work with generic values like NULL, VARCHAR or OTHER. 

可选值:JdbcType enumeration. Most common are: NULL, VARCHAR and OTHER 

默认值:OTHER 

文章作者: Bxan
版权声明: 本博客所有文章除特別声明外,均采用 CC BY 4.0 许可协议。转载请注明来源 Bxan !
  目录