run time exception

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • prisesh26
    New Member
    • Sep 2006
    • 29

    run time exception

    hi,

    iam getting exception (for duplicate key )displayed when i do ps.executeUpdat e(); i ll get this duplicate key exception rarely.
    but i dont want the whole eception to be displayed in the console. instead i want to display in single line. i want to display in single readable line

    i am catching the exception but still before it comes to catch section it is throwing the exception stack trace in my console.


    how to control this.
    please help.
  • BigDaddyLH
    Recognized Expert Top Contributor
    • Dec 2007
    • 1216

    #2
    Originally posted by prisesh26
    hi,

    iam getting exception (for duplicate key )displayed when i do ps.executeUpdat e(); i ll get this duplicate key exception rarely.
    but i dont want the whole eception to be displayed in the console. instead i want to display in single line. i want to display in single readable line

    i am catching the exception but still before it comes to catch section it is throwing the exception stack trace in my console.


    how to control this.
    please help.
    Are you executing this code from within an IDE? They can often trap exceptions at the moment they are created.

    Comment

    • JosAH
      Recognized Expert MVP
      • Mar 2007
      • 11453

      #3
      Originally posted by BigDaddyLH
      Are you executing this code from within an IDE? They can often trap exceptions at the moment they are created.
      Really? So this get trapped by an IDE?

      [code=java]
      MyException magritte= new MyException("ce ci n'est pas une erreur");
      [/code]

      kind regards,

      Jos

      Comment

      • BigDaddyLH
        Recognized Expert Top Contributor
        • Dec 2007
        • 1216

        #4
        Originally posted by JosAH
        Really? So this get trapped by an IDE?

        [code=java]
        MyException magritte= new MyException("ce ci n'est pas une erreur");
        [/code]

        kind regards,

        Jos
        Err, I mean that if you are executing code in debugging mode, execution may break at the point that the exception is thrown, to give you a chance to examine the context.

        Comment

        • JosAH
          Recognized Expert MVP
          • Mar 2007
          • 11453

          #5
          Ah, ok comprendo; no further questions your Honour.

          kind regards,

          Jos ;-)

          Comment

          Working...