skip to main content
JDBC Extensions : Using JDBC Wrapper Methods to Access JDBC Extensions
  

Try DataDirect Drivers Now

Using JDBC Wrapper Methods to Access JDBC Extensions

The Wrapper methods allow an application to access vendor-specific classes. The following example shows how to access the DataDirect-specific ExtConnection class using the Wrapper methods:
ExtStatementPoolMonitor monitor = null;
Class<ExtConnection> cls = ExtConnection.class;
if (con.isWrapperFor(cls)) {
ExtConnection extCon = con.unwrap(cls);
extCon.setClientUser("Joe Smith");
monitor = extCon.getStatementPoolMonitor();
}
...
if(monitor != null) {
long hits = monitor.getHitCount();
long misses = monitor.getMissCount();
}
...