Is it possible to use batch for SQL select statment?
I m using prepared statement-which is setting one argument and then immedietely it fires a SQL select query to fetch the data. This way it's not very effient as i keep on getting this argument in bulk and they are grouped in certain manner.
What i want to know whether i can addBatch() and then executeBatch() or some other varient of batch updates in SQL select kind of queries?
for(int i=0; i < someLenth; i++)
{
pstmt.setLong(1,arr[i])
pstmt.addBatch();
}
pstmt.executeBatch();
where pstmt is just a prepared statement.
I need a resultSet object just the way i can get it from pstmt.executeQuery()
I m using prepared statement-which is setting one argument and then immedietely it fires a SQL select query to fetch the data. This way it's not very effient as i keep on getting this argument in bulk and they are grouped in certain manner.
What i want to know whether i can addBatch() and then executeBatch() or some other varient of batch updates in SQL select kind of queries?
for(int i=0; i < someLenth; i++)
{
pstmt.setLong(1,arr[i])
pstmt.addBatch();
}
pstmt.executeBatch();
where pstmt is just a prepared statement.
I need a resultSet object just the way i can get it from pstmt.executeQuery()