net.ttddyy.dsproxy.proxy.ResultSetProxyLogic Maven / Gradle / Ivy
package net.ttddyy.dsproxy.proxy;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.sql.ResultSet;
import java.sql.ResultSetMetaData;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import static java.lang.Boolean.TRUE;
import static java.lang.String.format;
/**
* Allows {@link java.sql.ResultSet} to be consumed more than once.
*
* @author Liam Williams
* @see net.ttddyy.dsproxy.proxy.jdk.ResultSetInvocationHandler
* @see net.ttddyy.dsproxy.proxy.jdk.ResultSetProxyJdbcProxyFactory
* @see net.ttddyy.dsproxy.proxy.jdk.StatementResultSetResultInvocationHandler
* @since 1.4
*/
public class ResultSetProxyLogic {
private final Map columnNameToIndex;
private final ResultSet target;
private final int columnCount;
private int resultPointer;
private boolean resultSetConsumed;
private boolean closed;
private Object[] currentResult;
private final List