So I've been working on our project in Programming and it has something to do with adding product. Now, my AddProduct codes work however I would like to insert a code where in if I add the same name of the product that is already in the database then it will appear a Jdialog saying this product has been added already then the code will not add the product name on the database but if the name doesn't yet exists on the database then it will appear a Jdialog saying this product has been added to the database then the code will add the product name on database
The problem is I don't have any idea about the codes that I will use. Should I use if-else statement? Then if yes? How? Please I badly need your help Thank you so much