I am coding a small program that will supply the user with synonyms for words entered. I do no want you to code my program for me, I just need some help. I will provide an image to help you understand my problem. I would like to display an error message when the user entered a word that is not in the database.
Please refer to comment 1, this exception is used when the program fails to execute the Query. The problem is that it only works for certain errors like the incorrect spelling of a field or a missing column that is queried. So I cannot use it for this particular problem, it is only used for certain errors. Please refer to comment 2, the code is used to show me what data is being returned when a word is entered that does not exist. Please refer to comment 3, here I would like to do an if-statement to test whether or not the word has been found or not, if not an appropriate message will be displayed.
Basically what I need to know is how will Java respond to my query when the entered word is not found? It does not provide an error, only the following : sun.jdbc.odbc.JdbcOdbcR[email protected] (Please refer to my Query just above comment 2)
My program works fine it just does not provide the user with an error message when a word is entered that does not exist.
Wel die probleem is vir elke woord wat ek intik wat nie in die databasis is nie gee hy 'n ander boodskap. So die Lode-Metode gaan nie werk nie! As dit dieselfde resultaat gelewer het kon ek dalk iets gedoen het.