org.sfm.jdbc.impl.ResultSetEnumarable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of simpleFlatMapper Show documentation
Show all versions of simpleFlatMapper Show documentation
Java library to map flat record - ResultSet, csv - to java object with minimum configuration and low footprint.
The newest version!
package org.sfm.jdbc.impl;
import org.sfm.utils.Enumarable;
import org.sfm.utils.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;
}
}