AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Oracle errors using struts

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases
View previous topic :: View next topic  
Author Message
milkyway
Guest





PostPosted: Fri Jan 21, 2005 7:19 am    Post subject: Oracle errors using struts Reply with 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
anonymous
Guest





PostPosted: Fri Jan 21, 2005 9:27 am    Post subject: Re: Oracle errors using struts Reply with quote



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





PostPosted: Mon Jan 24, 2005 8:08 pm    Post subject: Re: Oracle errors using struts Reply with quote



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
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> Java and Databases All times are GMT
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.