Return-Path: X-Original-To: apmail-db-derby-commits-archive@www.apache.org Delivered-To: apmail-db-derby-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 5DFAEC77A for ; Wed, 26 Jun 2013 10:16:41 +0000 (UTC) Received: (qmail 50957 invoked by uid 500); 26 Jun 2013 10:16:41 -0000 Delivered-To: apmail-db-derby-commits-archive@db.apache.org Received: (qmail 50893 invoked by uid 500); 26 Jun 2013 10:16:38 -0000 Mailing-List: contact derby-commits-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: "Derby Development" List-Id: Delivered-To: mailing list derby-commits@db.apache.org Received: (qmail 50503 invoked by uid 99); 26 Jun 2013 10:16:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jun 2013 10:16:37 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 26 Jun 2013 10:16:36 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id C0F0423888E3; Wed, 26 Jun 2013 10:16:17 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1496870 - /db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java Date: Wed, 26 Jun 2013 10:16:17 -0000 To: derby-commits@db.apache.org From: dyre@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130626101617.C0F0423888E3@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dyre Date: Wed Jun 26 10:16:17 2013 New Revision: 1496870 URL: http://svn.apache.org/r1496870 Log: DERBY-1997: Remove custom exception printing methods and replace with printStackTrace as suggested Modified: db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java 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=1496870&r1=1496869&r2=1496870&view=diff ============================================================================== --- db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java (original) +++ db/derby/code/trunk/java/demo/workingwithderby/WwdEmbedded.java Wed Jun 26 10:16:17 2013 @@ -143,32 +143,8 @@ public class WwdEmbedded /* Catch all exceptions and pass them to ** the exception reporting 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 }