conn.setAutoCommit(false) PreparedStatement pstat = conn.prepareStatement(sql) pstat.setFetchSize(50) select all records in a large file for each record: read one field from the record through a second statement, add a record to a different table - XXX execute the second statement - YYY commit the change - ZZZ loop
It seems I can do one or the other but not both - or can I?
Correct. What you are trying to do requires that you open two sessions to the database (conn_read, conn_write) and execute the INSERT command on the conn_write connection while looping through data on the conn_read one.