• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

SQLExceptions: List of error codes for oracle?

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello There,

I am trying to handle SQLExceptions. The database used is Oracle 11g.
The purpose is to show user friendly messages based on the error codes.
To do this, i can find one way to go for error codes.
In the catch i will write switch statement having cases for different error codes and i will show
user friendly messages based on that.

The problem is, i did not found the list of error codes for oracle.
Can anybody please help on this.

Thanks,
Arfeen.
 
Sheriff
Posts: 3837
66
Netbeans IDE Oracle Firefox Browser
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is really, really a lot of them: http://docs.oracle.com/cd/E14072_01/server.112/e10880/e0.htm

In my opinion, most of them are not well suited to be shown to end users. Lots of them are connected to some low-level operation (say, additional space cannot be allocated for table or index). Either the user can administer the database, in which case he'll understand the message, or he cannot, in which case all he needs to do is to pass the message on to a DBA. If he'll pass a user-friendly message instead, the DBA might not understand what happened.

I personally only handle ORA-00001 (unique constraint violated) and ORA-02292 (integrity constraint violated - child record found). There could be a few others to handle this way, but not much. For all others I create an error report (a zip file) that contains the stack trace, log files and other diagnostic information, and display just a generic message ("An error occurred processing XXX. Please send the error report to ..."). Actually, this is how I handle all uncaught exceptions. (It is a Swing application, a web application might manage the error reporting a bit differently.)
 
arfeen khan
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much Martin for the descriptive link and your sincere suggestion.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic