catching sqlexception

Discussions

EJB programming & troubleshooting: catching sqlexception

  1. catching sqlexception (1 messages)

    Hello,
      I need suggestions for my 2 problems in EJB.

    1. I am getting an application exception thrown by the entity bean to the client.
    The session bean is called by the servlet.
    The entity bean is called by the session bean.
    I need to catch the sqlexception in my session bean.

    2. when i get a exception in my client and do exp.getMessage() , i am getting an entire printstacktrace of that exception.
    I like to have the one line exception details instead of printstacktrace.
    For example:
      if i get a sqlexception from my entity bean,
    in the client however i want to the line sqlexception.

    thanks in advance for the suggestions.

    radhakrishnan.



    Threaded Messages (1)

  2. catching sqlexception[ Go to top ]

    Radha,
      Try e.getLocalizedMessage()
    you may override this method in order to produce a locale-specific message.

    Thanks,
    Selva