So I have a database, within which there is a table with two columns: rightWord and wrongWord. I wish to select the rightWord value when the wrongWord value is equal to a variable declared in Java. I have the following code so far:
SELECT rightWord FROM dictionaryTable WHERE wrongWord = (?)
existingKeywords.next();
String rightWord = existsingKeywords.getString("rightWord");
That works and I am able to get the first value in rightWord column when wrongWord equals the Java variable. Now, how can I check if the any of the values in the wrongWord column does not match the Java variable? I have the above code in a for loop, and the value of the java variable is different every time.
Please help. Thanks!