I have a JDBC connection to a Sybase database and execute a stored procedure which recognizes that I'm doing something improper so it does a raiseerror. In my Java code the execute is being done in a try block that has a catch (Throwable e) that never gets called. Works fine in Oracle. What do I need to do on the sybase database?
I am experiencing the same problem too. When a Sybase stored procedure raises an error of severity > 10, a SQLException is supposed to be thrown by jConnect driver, but if you use CallableStatement.execute() method it does not throw an exception in this case. executeUpdate() will throw a SQLException but executeUpdate() is not supposed to be used for anything which returns a result set. Anyone who has gotten this to work?
I have met same issue in our app. I created preparedStatement, set all inputs and outputs and execute it. Nothing happen when I threw error inside called SP.
Solution which works for me is add just simple read of output value which throws exception...
It is a pity that after many years this was not fixed in Sybase or its jConnect drivers.