Is it allowed to use getGeneratedKeys() on PreparedStatement to get all the generated unique IDs (seq.nextval) generated in a batch update? please advice.
If it is not allowed please could you suggest a method to retrieve sequence Ids from a batch update.
Here is the requirement:
I have 2 tables DataTable1 (columns: ID, Name) and DataTable2 (REF-ID, value) and the relationship between these table is one-to-many:
I am using an batch insert into DataTable1 to add multiple rows and each row's ID is unique and it is generated by seq.nextval. Now, after this batch insert I need to retrieve all the generated IDs and use these IDs to inser data into the second table(DataTable2).