Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Java (http://www.velocityreviews.com/forums/f30-java.html)
-   -   Oracle errors using struts (http://www.velocityreviews.com/forums/t140299-oracle-errors-using-struts.html)

milkyway 01-21-2005 07:19 AM

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?


anonymous 01-21-2005 09:27 AM

Re: Oracle errors using struts
 
milkyway wrote:
> 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.

Bob Kranson 01-24-2005 08:08 PM

Re: Oracle errors using struts
 
Isn't this the purpose of the FINALLY clause in java?

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1106291966.437327.261860@z14g2000cwz.googlegr oups.com...
> 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?
>





All times are GMT. The time now is 08:25 PM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.