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不识别,修改前代码
修改后:
即使用resultMap来指定类型,就可以了