diff geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java @ 130:e4eacd613356

Implementierung Datenzugriff auf die ArcSDE über java.sql. Methodiken ChangeLog wird nachgereicht da SubversionClientincompatiblitäten vorhanden sind. geo-backend/trunk@7 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Tim Englich <tim.englich@intevation.de>
date Wed, 02 Sep 2009 15:15:52 +0000
parents
children 12f88239fb33
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/geo-backend/src/main/java/de/intevation/gnv/geobackend/base/connectionpool/exception/ConnectionException.java	Wed Sep 02 15:15:52 2009 +0000
@@ -0,0 +1,114 @@
+/**
+ * Title:           lConnectionException, $Header: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/exception/ConnectionException.java,v 1.2 2008/08/18 14:50:33 drewnak Exp $
+ * Source:          $Source: /share/gdi/SDI-Suite/Repository/projekte/BSH-GDI/genericViewer/src/main/java/de/conterra/bsh/gdi/gnviewer/exception/ConnectionException.java,v $
+ * created by:      Stefan Blume (blume)
+ * erstellt am:     21.11.2007
+ * Copyright:       con terra GmbH, 2005
+ *
+ * modified by:     $Author: drewnak $
+ * modified on:     $Date: 2008/08/18 14:50:33 $
+ * Version:         $Revision: 1.2 $
+ * TAG:             $Name:  $
+ * locked from:     $Locker:  $
+ * CVS State:       $State: Exp $
+ * Project:         $ProjectName$
+ */
+package de.intevation.gnv.geobackend.base.connectionpool.exception;
+
+import com.esri.sde.sdk.client.SeError;
+import com.esri.sde.sdk.client.SeException;
+
+import de.intevation.gnv.geobackend.sde.datasources.exception.TechnicalException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * The class <code>lConnectionException</code> fulfills the following purposes:
+ * <ol>
+ * <li></li>
+ * </ol>
+ *
+ * @author blume
+ * @version 1.0
+ * @serial 1.0
+ * @see
+ * @since 21.11.2007 08:13:05
+ */
+public class ConnectionException extends TechnicalException {
+
+    /**
+     * Default Logging instance
+     */
+    private static Logger sLogger = Logger.getLogger(ConnectionException.class);
+
+    /**
+     * Constructs a new exception with <code>null</code> as its detail message.
+     * The cause is not initialized, and may subsequently be initialized by a
+     * call to {@link #initCause}.
+     */
+    public ConnectionException() {
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message.  The
+     * cause is not initialized, and may subsequently be initialized by
+     * a call to {@link #initCause}.
+     *
+     * @param message the detail message. The detail message is saved for
+     *                later retrieval by the {@link #getMessage()} method.
+     */
+    public ConnectionException(String message) {
+        super(message);
+    }
+    public ConnectionException(Throwable pCause) {
+        super(pCause);
+    }
+
+    /**
+     * Constructs a new exception with the specified detail message and
+     * cause.  <p>Note that the detail message associated with
+     * <code>cause</code> is <i>not</i> automatically incorporated in
+     * this exception's detail message.
+     *
+     * @param message the detail message (which is saved for later retrieval
+     *                by the {@link #getMessage()} method).
+     * @param cause   the cause (which is saved for later retrieval by the
+     *                {@link #getCause()} method).  (A <tt>null</tt> value is
+     *                permitted, and indicates that the cause is nonexistent or
+     *                unknown.)
+     * @since 1.4
+     */
+    public ConnectionException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Displays the details of an SeException (if available).
+     *
+     */
+    public void printError() {
+        if (getCause() != null && getCause() instanceof SeException) {
+            SeException exception = (SeException) getCause();
+            SeError error = exception.getSeError();
+
+            sLogger.debug("\n ArcSDE Error Number        : " + error.getSdeError());
+            sLogger.debug(" Error Description          : " + error.getErrDesc());
+
+            int extError = error.getExtError();
+            if (extError != 0)
+                sLogger.debug(" Extended Error Number      : " + extError);
+
+            String desc = error.getSdeErrMsg();
+            if (desc != null && desc.length() != 0)
+                sLogger.debug(" Extended Error Description : " + desc);
+
+            desc = error.getExtErrMsg();
+            if (desc != null && desc.length() != 0)
+                sLogger.debug(" Extended Error Description : " + desc);
+
+            sLogger.debug(exception);
+
+        }
+
+    }
+}

http://dive4elements.wald.intevation.org