Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
package net.dongliu.dbutils;
import net.dongliu.commons.exception.Exceptions;
import net.dongliu.dbutils.handlers.ArrayRowProcessor;
import net.dongliu.dbutils.handlers.BeanRowProcessor;
import net.dongliu.dbutils.handlers.MapRowProcessor;
import java.sql.Connection;
import java.sql.SQLException;
import java.util.Map;
import java.util.stream.Stream;
/**
* For hold sql execute infos
*
* @author Liu Dong
*/
public class SQLInfo {
private static final SqlExecutor sqlExecutor = new SqlExecutor();
private Connection connection;
private boolean closeConn;
private String clause;
private Object[] params;
private int fetchSize;
SQLInfo() {
}
/**
* Executes the SQL query and return result as stream.
* You need consume all data in stream, or close stream manually
*/
public Stream queryAsStream(RowProcessor processor) {
try {
return sqlExecutor.queryAsStream(connection, closeConn, fetchSize, clause, processor, params);
} catch (SQLException e) {
throw Exceptions.sneakyThrow(e);
}
}
/**
* Query result as Object array stream, with column index as array index
*/
public Stream