protected static DatabaseMetaData getDatabaseMetaData(DatabaseMetaData databaseMetaData, Connection wrappedConnection) {
return (DatabaseMetaData) getProxy(databaseMetaData, new ProxyDatabaseMetaData(databaseMetaData, wrappedConnection), null);
}
private static Object getProxy(Object delegate, Callback callback, ConnectionPoolDefinitionIF def) {
Enhancer e = new Enhancer();
e.setNamingPolicy(NAMING_POLICY);
e.setInterfaces(getInterfaces(delegate.getClass(), def));
e.setCallback(callback);
e.setClassLoader(ProxyFactory.class.getClassLoader());
return e.create();
}