java - How to insert only unique values from a CSV file in Oracle database? -


I am uploading a CSV file using a service file and putting it in an oracle table using JDBC I am I need to put only the unique value in the CSV file. If the value in the CSV file is already in the database table, then it should not be entered in the table. So just enter only unique values ​​from CSV file.

These options should help avoid additional DB calls to handle this situation. Option 1: Very simple and requires minimal coding ... but works when there is no global transaction limit.

In case of any barrier exception, go to all inserts, just grab it and do "nothing", for any other value loop

option 2: every time you To add CSV before adding it, just check that the object is already present (eg: array list.) And continue to add only when there is no object with the same data. Finally, put a bulk. Note: If the data is large, go for the set data set for bulk dot.

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -