wood burning stoves*
The moose likes JDBC and the fly likes How to catch sybase raiseerror in java ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to catch sybase raiseerror in java ? " Watch "How to catch sybase raiseerror in java ? " New topic

How to catch sybase raiseerror in java ?

Shan Tiruvarur

Joined: Feb 14, 2005
Posts: 5
assume i am doing this

query= "exec <stored proc name>"

now, this is a single line stored proc.
raiseerror 100001

how do i catch this raiseerror thing back in java ?
i tried catching SQLException but
raiseerror is not wrapped into SQLException.

can someone help me with this ?
Steve Knott

Joined: Apr 26, 2004
Posts: 2
set nocount on in the sp.
The error code should now be in the resultset on the statement.
perform a ResultSet.next() and getInt()
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: How to catch sybase raiseerror in java ?
Similar Threads
getting ResultSet from Java Stored Procedure
Calling COBOL stored proc from Java Servlet
Oracle stored procedures
Difference detween execute() and executeUpdate()..?
How to handle RAISEERROR in Sybase using JDBC