All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sfm.jdbc.impl.ResultSetEnumarable Maven / Gradle / Ivy

Go to download

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;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy