db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chaa...@apache.org
Subject svn commit: r1576342 - in /db/derby/code/trunk/java/demo/workingwithderby: WwdClientExample.java WwdEmbedded.java
Date Tue, 11 Mar 2014 13:42:37 GMT
Author: chaase3
Date: Tue Mar 11 13:42:37 2014
New Revision: 1576342

URL: http://svn.apache.org/r1576342
Log:
DERBY-1997  Misleading text in WwdEmbedded demo source file for Working With Derby

Modified two demo source files to make embedded and client error handling identical.

Patch: DERBY-1997.diff

Modified:
    db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java
    db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java

Modified: db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java?rev=1576342&r1=1576341&r2=1576342&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java (original)
+++ db/derby/code/trunk/java/demo/workingwithderby/WwdClientExample.java Tue Mar 11 13:42:37
2014
@@ -121,37 +121,13 @@ public class WwdClientExample
                }  
             }
             
-         //  Beginning of the primary catch block: uses errorPrint method
+         //  Beginning of the primary catch block: prints stack trace
          }  catch (Throwable e)  {   
             /*       Catch all exceptions and pass them to 
-            **       the exception reporting method             */
+             *       the Throwable.printStackTrace method  */
             System.out.println(" . . . exception thrown:");
-            errorPrint(e);
+            e.printStackTrace(System.out);
          }
          System.out.println("Getting Started With Derby JDBC program ending.");
       }
-     //   ## DERBY EXCEPTION REPORTING CLASSES  ## 
-    /***     Exception reporting methods
-    **      with special handling of SQLExceptions
-    ***/
-      static void errorPrint(Throwable e) {
-         if (e instanceof SQLException) 
-            SQLExceptionPrint((SQLException)e);
-         else {
-            System.out.println("A non SQL error occured.");
-            e.printStackTrace();
-         }   
-      }  // END errorPrint 
-
-    //  Iterates through a stack of SQLExceptions 
-      static void SQLExceptionPrint(SQLException sqle) {
-         while (sqle != null) {
-            System.out.println("\n---SQLException Caught---\n");
-            System.out.println("SQLState:   " + (sqle).getSQLState());
-            System.out.println("Severity: " + (sqle).getErrorCode());
-            System.out.println("Message:  " + (sqle).getMessage()); 
-            sqle.printStackTrace();  
-            sqle = sqle.getNextException();
-         }
-   }  //  END SQLExceptionPrint   	
 }

Modified: db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java?rev=1576342&r1=1576341&r2=1576342&view=diff
==============================================================================
--- db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java (original)
+++ db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java Tue Mar 11 13:42:37 2014
@@ -125,10 +125,10 @@ public class WwdEmbedded
                }  
             }
             
-         //  Beginning of the primary catch block: uses errorPrint method
+         //  Beginning of the primary catch block: prints stack trace
          }  catch (Throwable e)  {   
             /*       Catch all exceptions and pass them to 
-            **       the exception reporting method             */
+             *       the Throwable.printStackTrace method  */
             System.out.println(" . . . exception thrown:");
             e.printStackTrace(System.out);
          }



Mime
View raw message