This may be asked a lot but,
so I am trying to insert a 4 million records to a database using java,
I did a lot of googling and tried access and MySQL. Both were almost the same,
with MySQL I tried statement.addBatch();
but still takes forever.
the question is, what is the best time I can get ? and what is the best way ?
counter++;
String sqlQuery = "INSERT INTO employees VALUES("some query")";
sqlState.addBatch(sqlQuery);
if (counter == 1000) {
sqlState.executeBatch();
counter = 0;
}
Also am I using the Batch right ?