I am interacting with SQL Server 2005 from a jsp via JDBC (this is an assignment not a real project) and I have created a trigger in the database I am using. If a certain condition is not met when this trigger executes I raise an error via raiserror(). I would like this error to be displayed on the actual page that calls the SQL Server query via JDBC, but currently I am just getting the following default message when I print out the result of SQLException.getMessage():
The transaction ended in the trigger. The batch has been aborted.
Does anyone know how to extract the text I actually passed to raiserror in my trigger code? I have already tried:
SQLException.getState() SQLException.getNextException() SQLException.getCause() SQLException.toString()