I'm supposed to do a stress testing on my application for which I need 60 million records in a table. The approach I'm following is, first I'm initializing the instance of Connection class, then inserting the data using a for loop by PreparedStatement using that Connection, and after every 500 rows insertion I'm committing the connection and resetting it.
Using this, I'm able to insert approx 150 records per minute. I just want to know if there's any more optimized way of doing it so that time required for execution is minimal