I am new to Spring . I am using ComboPooledDataSource for connection pooling in Spring.
I am using the AS400 for making the connection.
My problem is that when I am using this connection and try to typecast this
AS400JDBCConnection as400Conn = (AS400JDBCConnection)conn;
It gives the ClassCastCastException because the connection object returned by the ComboPooledDataSource is of type NewProxyConnection how can I typecast it into AS400JDBCConnection.
I am new to Spring . I am using ComboPooledDataSource for connection pooling in
Share
Spring does support unwrapping the proxied ComboPooledDataSource object. If you are using JdbcTemplate, you can set the nativeJdbcExtractor property to an appropriate object. So any place you can retrieve a native Connection or even any of the derived objects (like ResultSet) will be native.
The JavaDoc for the NativeJdbcExtractor interface for a list of supported classes. That can help you decide which implementation works for you application.