Oracle errors using struts

M

milkyway

Hello,

I have a small program whereby some data is being fetched from the
database (Oracle). As part of the program, I have "try .... catch"
statements just in case something strange happens. The statement is
something like (BTW, it is just pseudocode, not actual code):


TRY.
execute_query( l_query ).

CATCH cx_sql_exception.

ENDTRY.


As of now, if an error happens (using tomcat webserver) the whole
server shuts down. What can I do to this statement to forward it to an
error page or some other type of page? How is error handling with an
Oracle database (or data bases in general) done?
 
A

anonymous

milkyway said:
Hello,

I have a small program whereby some data is being fetched from the
database (Oracle). As part of the program, I have "try .... catch"
statements just in case something strange happens. The statement is
something like (BTW, it is just pseudocode, not actual code):


TRY.
execute_query( l_query ).

CATCH cx_sql_exception.

ENDTRY.


As of now, if an error happens (using tomcat webserver) the whole
server shuts down. What can I do to this statement to forward it to an
error page or some other type of page? How is error handling with an
Oracle database (or data bases in general) done?
For my stuff, I usually use stored procedures with Oracle, so I always
get something back, usually xml. If a database error occurred, I get the
sqlcode and sqlemsg back and am free to decide if I want that to go back
to the browser or write it into the log file, while I send something
nicer back to the user.
Obviously, I never call Oracle from anything but a bean which knows how
to format the appropriate response from the jdbc call. There is no
reason for the entire server to crash.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top