Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic getObject method in DruidPooledResultSet #1527

Open
ArronDLin opened this issue Dec 2, 2016 · 1 comment
Open

Generic getObject method in DruidPooledResultSet #1527

ArronDLin opened this issue Dec 2, 2016 · 1 comment

Comments

@ArronDLin
Copy link

ArronDLin commented Dec 2, 2016

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants