I need to insert multiple records into mysql database at once. What I am doing is SELECT
on one table, from my application with Prepared statement. What I must do is to insert those results into one other temporary table.
String sqlquery = "select * from table1 where arg1 = ?";
PreparedStatement statement;
statement = con.prepareStatement(sql);
ArrayList<String>termlist = index.getTermList();
for (int i = 0; i < termlist.size(); i++)
{
String search = termlist.get(i);
statement.setString(1,search);
ResultSet rs1 = statement.executeQuery(); //
}
These sets might be big. What is the fastest way to insert this ResultSet somehow into my other table, after each iteration?
How to pass this resultsset to some stored procedure, if there is way?