Solved

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

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

Transaction Monitoring Vs. Real User Monitoring

Synthetic Transaction Monitoring Vs. Real User Monitoring: When To Use Each Approach? In this article, we will discuss two major monitoring approaches: Synthetic Transaction and Real User Monitoring.

Question has a verified solution.

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

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
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