MySQL Type Name | Return value of GetColumnClassName | Return value of GetColumnClassName |
---|---|---|
TINYINT | TINYINT | java.lang.Boolean if the configuration property tinyInt1isBit is set to true (the default) and the storage size is 1, or java.lang.Integer if not. |
BOOL, BOOLEAN | TINYINT | See TINYINT, above as these are aliases for TINYINT(1), currently. |
翻译:
如果tinyInt1isBit =true(默认),且tinyInt存储长度为1 ,则转为java.lang.Boolean 。
否则转为java.lang.Integer。
资料链接
https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-reference-type-conversions.html
解决办法
jdbc链接url上面加上tinyInt1isBit=false
参数
例如: jdbc:mysql://
所有评论仅代表网友意见