public static ResultSet newInstance(ResultSet rs, Log statementLog, int queryStack) {
    InvocationHandler handler = new ResultSetLogger(rs, statementLog, queryStack);
    ClassLoader cl = ResultSet.class.getClassLoader();
    return (ResultSet) Proxy.newProxyInstance(cl, new Class[]{ResultSet.class}, handler);
  }
ResultSet proxy to add logging

@author Clinton Begin
@author Eduardo Macarron
src/main/java/org/apache/ibatis/logging/jdbc/ResultSetLogger.java