Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 737
  • Last Modified:

How do I get Sybase ASE to throw an error that Java can catch?

Good Morning All,

I am in need of some expert advice.  My environment is set up as follows:  
Database:  Sybase ASE 15.7, Open Client 15
Language:  Java 1.7.0_45

I have a stored procedure that is raising an error but java is not catching it.  Is there any way that I can force it.  I see ways to do this in other databases but nothing for Sybase.

I am performing a batch update using prepared statements and the update being called to perform the update is where the raiserror is thrown.
1
Monica Stanley
Asked:
Monica Stanley
  • 2
  • 2
1 Solution
 
John_VidmarCommented:
Sybase ASE has a function called RAISERROR
1
 
Monica StanleyInformation Technology SpecialistAuthor Commented:
I am aware of the RAISERROR function.  I use it extensively.  My problem is this it is not being caught in the SQLException block.
1
 
John_VidmarCommented:
In your Java try-catch, add a more generic exception-type first, and trace through your code to see what (if anything) is being caught.
0
 
Monica StanleyInformation Technology SpecialistAuthor Commented:
Thank you for taking the time to answer John.  I just realized that I was not on the correct database sever and was calling a version of my stored procedure that does not have the raise error in it.  It is working correctly now.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now