mybatis 处理长字段(long varchar)

做项目,遇到一个比较郁闷的问题,DB2字段longvarchar字段mybatis无法解析

RT,控制台报错如下:

org.springframework.jdbc.UncategorizedSQLException: Error attempting to get column 'XXXX' from result set. Cause: com.ibm.db2.jcc.b.ug: Invalid data conversion: Wrong result column type for requested conversion.
; uncategorized SQLException for SQL []; SQL state [null]; error code [-99999]; Invalid data conversion: Wrong result column type for requested conversion.; nested exception is com.ibm.db2.jcc.b.ug: Invalid data conversion: Wrong result column type for requested conversion.

查资料发现,XXXX字段mybatis不识别,修改前代码

mybatis 处理长字段(long varchar)_第1张图片

修改后:

mybatis 处理长字段(long varchar)_第2张图片

 

 即使用resultMap来指定类型,就可以了

 

转载于:https://www.cnblogs.com/xiangyuan12138/p/7874936.html

你可能感兴趣的:(mybatis 处理长字段(long varchar))