 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
milkyway Guest
|
Posted: Fri Jan 21, 2005 7:19 am Post subject: Oracle errors using struts |
|
|
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?
|
|
| Back to top |
|
 |
anonymous Guest
|
Posted: Fri Jan 21, 2005 9:27 am Post subject: Re: Oracle errors using struts |
|
|
milkyway wrote:
| Quote: | 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.
|
|
| Back to top |
|
 |
Bob Kranson Guest
|
Posted: Mon Jan 24, 2005 8:08 pm Post subject: Re: Oracle errors using struts |
|
|
Isn't this the purpose of the FINALLY clause in java?
"milkyway" <d0mufasa (AT) hotmail (DOT) com> wrote
| Quote: | 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?
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|