RDBDataSourceFactory.CloseableDataSource doesn't implement java.sql.Wrapper correctly
Fixed implementation to respect Wrapper contract.
@@ -134,12 +134,12 @@ public class RDBDataSourceFactory {
@Override
public boolean isWrapperFor(Class<?> c) throws SQLException {
- return c.isInstance(this.ds) || this.ds.isWrapperFor(c);
+ return c.isInstance(this) || c.isInstance(this.ds) || this.ds.isWrapperFor(c);
}
@Override
public <T> T unwrap(Class<T> c) throws SQLException {
- return c.isInstance(this.ds) ? (T) this.ds : this.ds.unwrap(c);
+ return c.isInstance(this) ? (T) this : c.isInstance(this.ds) ? (T) this.ds : this.ds.unwrap(c);
}
@Override
