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
Solved

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

Posted on 2014-11-14
4
557 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
  • 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb entity bean example 2 9
intellij error 2 17
web project error add remove 1 27
TSQL Challenge... 7 35
I had a project requirement for a displaying a user workbench .This workbench would consist multiple data grids .In each grid the user will be able to see a large number of data. These data grids should allow the user to 1. Sort 2. Export the …
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
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.

809 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