0
点赞
收藏
分享

微信扫一扫

MyBatis: 向oracle表中插入null字段的处理


一、可以在SQL中指定类型:

@Insert("insert into student values(#{name,jdbcType=NULL},#{age})")
    int addStudent(@Param("name")String name, @Param("age") int age);

二、可以进行全局配置(单独使用MyBatis时可如下配置)

MyBatis: 向oracle表中插入null字段的处理_数据库

如果不进行配置,将报错

MyBatis: 向oracle表中插入null字段的处理_数据库_02


举报

相关推荐

0 条评论