java.sql.SQLException: Invalid column type: 1111

mybatis链接oracle的时候如果传的值为null就可能会出现这个问题。

解决方案,mybatis中字段的书写规范些,加上jdbcType。

如下:

    <select id="selectById" parameterType="String" resultMap="assets" databaseId="oracle">
        SELECT *
        FROM ${db}."assets"
        WHERE "resource_id" = #{assetsId, jdbcType=VARCHAR}
    </select>

这里的id是字符串类型所以对应的是VARCHAR。

猜你喜欢

转载自blog.csdn.net/qq_35981283/article/details/79586157