Re: SQLServerException and Raiserror
- From: Joe Weinstein <joeNOSPAM@xxxxxxx>
- Date: Wed, 22 Feb 2006 10:12:10 -0800
Shantanu wrote:
I do not have access to connection or statement.
Ok, then you're out of luck unless you have access to the
JDBC objects involved...
Joe
I just get SQLServerException thrown to me. I tried doing getCause() and getNextException() but no luck.
Thanks
Shantanu
"Joe Weinstein" wrote:
Shantanu wrote:
Hello,
I am bit new to SQLServer JDBC drivers. We have a database trigger that raises a user defined exception using Raiserror. e.g. Raiserror( 'Trigger has failed because ......
When I get SQLServerException in my Java code, I can only access the server error that says something like below
SQL Error: 3609, SQLState: S0001
The transaction ended in the trigger. The batch has been aborted.
Is there a way I can access error message defined by me?
Many Thanks
Make the getWarnings() call on the connection and statement, and see if
the raiserror message is attached via warnings. Also call the SQLException's
getNextException() to see if you got a chain of exceptions, with the info
you want in one of those.
Joe Weinstein at BEA Systems
.
- References:
- Re: SQLServerException and Raiserror
- From: Joe Weinstein
- Re: SQLServerException and Raiserror
- Prev by Date: Re: SQLServerException and Raiserror
- Next by Date: Re: Callablestatement.execute() and clearParameter() causing excep
- Previous by thread: Re: SQLServerException and Raiserror
- Index(es):
Loading