Solved

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

Posted on 2014-11-14
4
585 Views
1 Endorsement
Last Modified: 2014-11-18
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
Comment
Question by:Monica Stanley
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 11

Accepted Solution

by:
John_Vidmar earned 500 total points
ID: 40443810
Sybase ASE has a function called RAISERROR
1
 

Author Comment

by:Monica Stanley
ID: 40448041
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
 
LVL 11

Expert Comment

by:John_Vidmar
ID: 40448605
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
 

Author Closing Comment

by:Monica Stanley
ID: 40450806
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

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

I'm trying, I really am. But I've seen so many wrong approaches involving date(time) boundaries I despair about my inability to explain it. I've seen quite a few recently that define a non-leap year as 364 days, or 366 days and the list goes on. …
If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question