org.simpleflatmapper.jdbc.impl.ResultSetEnumarable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sfm-jdbc Show documentation
Show all versions of sfm-jdbc Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
package org.simpleflatmapper.jdbc.impl;
import org.simpleflatmapper.util.Enumarable;
import org.simpleflatmapper.util.ErrorHelper;
import java.sql.ResultSet;
import java.sql.SQLException;
public class ResultSetEnumarable implements Enumarable {
private final ResultSet resultSet;
public ResultSetEnumarable(ResultSet resultSet) {
this.resultSet = resultSet;
}
@Override
public boolean next() {
try {
return resultSet.next();
} catch(SQLException e) {
ErrorHelper.rethrow(e);
return false;
}
}
@Override
public ResultSet currentValue() {
return resultSet;
}
}