Oracle errors using struts

Discussion in 'Java' started by milkyway, Jan 21, 2005.

  1. milkyway

    milkyway Guest

    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?
    milkyway, Jan 21, 2005
    #1
    1. Advertising

  2. milkyway

    anonymous Guest

    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.
    anonymous, Jan 21, 2005
    #2
    1. Advertising

  3. milkyway

    Bob Kranson Guest

    Isn't this the purpose of the FINALLY clause in java?

    "milkyway" <> wrote in message
    news:...
    > 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?
    >
    Bob Kranson, Jan 24, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Mark Goldin

    Errors, errors, errors

    Mark Goldin, Jan 17, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    937
    Mark Goldin
    Jan 17, 2004
  2. Benson, John
    Replies:
    1
    Views:
    2,215
    Aurelio Martin
    Jan 28, 2004
  3. Pieter Claerhout
    Replies:
    0
    Views:
    598
    Pieter Claerhout
    Jan 28, 2004
  4. Replies:
    0
    Views:
    738
  5. Feyruz
    Replies:
    4
    Views:
    2,154
    Sherm Pendley
    Oct 14, 2005
Loading...

Share This Page