Sorry, this question might sound silly, but I need some help!
My project is to open a directory and list all the files. These are csv files. Each file is opened and the contents are loaded into the table in a mysql database.
So I have done the above steps, and my java code works fine. For instance, I have 3 files in the directory. When I run the project, the values in each of the 3 files are loaded into the mysql table.
But when I run the program again and check the database using Select statement, it shows me the repeated data and hence the values of 6 files are loaded. When I run it again, the database shows 9 files. But I dont want the files to be added again.
So can anyone please tell me about how to achieve this without the need to delete the already added files from the directory.
Thanks in advance
Have a Unique file identifier in DB and in physical file also.
Check for this if it exist skip else perform DB operation