
com.google.code.eforceconfig.jdbc.DBFetchableData Maven / Gradle / Ivy
The newest version!
package com.google.code.eforceconfig.jdbc;
import java.sql.ResultSet;
import java.sql.SQLException;
import org.apache.log4j.Logger;
import java.sql.Date;
/**
*
* Easy to use java.sql.ResultSet wrapper
*
*/
public class DBFetchableData
{
public static int FETCH_FORWARD= ResultSet.FETCH_FORWARD;
public static int FETCH_REVERSE= ResultSet.FETCH_REVERSE;
public static int FETCH_UNKNOWN= ResultSet.FETCH_UNKNOWN;
private static Logger logger= Logger.getLogger(DBFetchableData.class);
private int cols;
private String[] aliases;
private ResultSet rs;
private Exception exception;
public DBFetchableData(String[] aliases, ResultSet rs, int cols)
{
this.cols= cols;
this.aliases= aliases;
this.rs= rs;
}
public String[] getAliases()
{
return aliases;
}
public int getCols()
{
return cols;
}
public boolean next()
throws SQLException
{
return rs.next();
}
public int getIndexFor(String colName)
throws Exception
{
int res=0;
boolean found= false;
for (;res
© 2015 - 2025 Weber Informatics LLC | Privacy Policy