Hello. I'm finishing a java app that works with a mysql database. I need a way to capture mysql errors and display them with a customized text. For example, if I try to delete a row that has a foreign key to another table, I need to catch that error, and display a JOptionPane.showMessageDialog saying something like "Cannot delete the row. Please make sure the ID has no other links". Same with when I get the duplicity error on primary keys. Any ideas?