class SQLReader {

    public void read(TableReader tableReader, String fileName, String tableName) {
        try (SQLiteConnection conn = SQLiteConnection.create(fileName)) {
            ResultConsumer rowConsumer = new ResultConsumer(tableReader, tableName);

            conn.consumeTable(tableName, rowConsumer);
        } catch (SQLException e) {
            logger.error("Failed to read SQL from table: " + tableName, e);
        }
        tableReader.fileFinished();
    }

}