• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Devaka Cooray
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • Tim Holloway
Bartenders:
  • Jj Roberts
  • Al Hobbs
  • Piet Souris

JDBC Sybase Stored Procedure Exception

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a JDBC connection to a Sybase database and execute a stored procedure which recognizes that I'm doing something improper so it does a raiseerror. In my Java code the execute is being done in a try block that has a catch (Throwable e) that never gets called. Works fine in Oracle.
What do I need to do on the sybase database?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am experiencing the same problem too. When a Sybase stored procedure raises an error of severity > 10, a SQLException is supposed to be thrown by jConnect driver, but if you use CallableStatement.execute() method it does not throw an exception in this case. executeUpdate() will throw a SQLException but executeUpdate() is not supposed to be used for anything which returns a result set.
Anyone who has gotten this to work?
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have met same issue in our app. I created preparedStatement, set all inputs and outputs and execute it. Nothing happen when I threw error inside called SP.
Solution which works for me is add just simple read of output value which throws exception...



It is a pity that after many years this was not fixed in Sybase or its jConnect drivers.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic