I filled an array using .split(" ") on a string containing a paragraph of text scanned from a webpage. I would like to insert each element of the array into a table but only if said word does not already exist in the table. So each word should only exist in the table once.
I am using the following statement to check if the word exists in the table already:
SELECT * FROM table WHERE word = "**Word to check for**";
In my java program, how can I check if the statement returns an empty set or not? i.e. what would be the condition of my if statement? Would I check if the above SELECT query returns 0 rows?
Thanks,