Implement unwrap()

pull/60/head
Brett Wooldridge 11 years ago
parent 4a410d8593
commit 5e1b7be484

@ -146,10 +146,15 @@ public class HikariDataSource extends HikariConfig implements DataSource
/** {@inheritDoc} */ /** {@inheritDoc} */
@Override @Override
@SuppressWarnings("unchecked")
public <T> T unwrap(Class<T> iface) throws SQLException public <T> T unwrap(Class<T> iface) throws SQLException
{ {
// TODO Auto-generated method stub if (pool != null && iface.isInstance(pool.dataSource))
return null; {
return (T) pool.dataSource;
}
throw new SQLException("Wrapped connection is not an instance of " + iface);
} }
/** {@inheritDoc} */ /** {@inheritDoc} */

Loading…
Cancel
Save