Subject Re: How do I get my Firebird exception name or number
Author Roman Rokytskyy
Hi,

> I set up different exception in by database, and they sometimes
> occur :)
>
> How do I get their number (ID) or better their names?
>
> While debugging I can see this name and ID in
> org.firebirdsql.jdbc.FBSQLException object when I browse wrapped
> objects (pressing (+) in JBuilder on "next" several times), but when
> I use fe.getErrorCode() method I get number like 335544382...

I afraid you cannot get your exception ID from SQLException. As far as
I know server does not send this information as a separate parameter.
Error code 335544382 means isc_random, and provides only string
message that is sent by the server. The only possible way to extract
your information is to parse SQLException message.

> What id the right way to catch my exceptions and perform different
> actions on different exceptions?

Check the error code. However, do not expect that server will return
error code for your custom exception. In this case you have to parse
message.

Hope this helps.

Best regards,
Roman Rokytskyy