druid Generic getObject method in DruidPooledResultSet

cx6n0qe3  于 2021-11-27  发布在  Java
关注(0)|答案(1)|浏览(356)

Is there any good reason that the generic getObject method in DruidPooledResultSet is not implemented but just throw SQLFeatureNotSupportedException?

public <T> T getObject(int columnIndex, Class<T> type) throws SQLException {
        throw new SQLFeatureNotSupportedException();
    }

We have been suffering from the below exception when using Spring BeanPropertyRowMapper to map a field which is an enum.

DEBUG [JdbcUtils.java:203] JDBC driver does not support JDBC 4.1 'getObject(int, Class)' method
java.sql.SQLFeatureNotSupportedException
	at com.alibaba.druid.pool.DruidPooledResultSet.getObject(DruidPooledResultSet.java:1767)
	at org.springframework.jdbc.support.JdbcUtils.getResultSetValue(JdbcUtils.java:197)
	at org.springframework.jdbc.core.BeanPropertyRowMapper.getColumnValue(BeanPropertyRowMapper.java:337)
	at org.springframework.jdbc.core.BeanPropertyRowMapper.mapRow(BeanPropertyRowMapper.java:265)
	at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:93)
	at org.springframework.jdbc.core.RowMapperResultSetExtractor.extractData(RowMapperResultSetExtractor.java:60)
	at org.springframework.jdbc.core.JdbcTemplate$1.doInPreparedStatement(JdbcTemplate.java:693)
	at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:629)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:680)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:707)
	at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:757)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:192)
	at org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate.query(NamedParameterJdbcTemplate.java:204)
	at org.macula.plugins.admin.base.service.impl.SettingSynchronizationServiceImpl.diffOverview(SettingSynchronizationServiceImpl.java:89)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
n53p2ov0

n53p2ov01#

这些issues没人回复,也没人关闭,也完全无说明,不知道什么意思?

相关问题