AcceptMediocrity opened a new issue, #37757:
URL: https://github.com/apache/shardingsphere/issues/37757

   
https://github.com/apache/shardingsphere/blob/57ac720ec058386e35fdd760e6627177cb12ca50/infra/executor/src/main/java/org/apache/shardingsphere/infra/executor/sql/execute/result/query/impl/driver/jdbc/type/util/ResultSetUtils.java#L67
   
   issue:
   有些老项目数据库定义与java的对象定义不是严格匹配导致数据源切换shardingJDBC后报错。
   version: (项目使用的5.3.2) - latest
   目前master分支对于String也只支持转换Timestamp,java.sql.Date,Time三种。
   
   原因:
   项目中还会存在String对于Integer类似这种没有兼容: (实际项目中使用了mybatis-plus的@EnumValue 
修饰的java对象类型为Integer,数据库定义为char。在com.baomidou.mybatisplus.core.handlers.MybatisEnumTypeHandler#getNullableResult(java.sql.ResultSet,
 int)中获取值时是调用了Object value = rs.getObject(columnIndex, this.propertyType);)
   对于原生的com.mysql.cj.jdbc.result.ResultSetImpl#getObject(int, 
java.lang.Class<T>)中是支持的。
   
   建议:
   所以建议是否考虑使用原生的方法兼容(目前做法是把数据库中的类型修改了)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: 
[email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to