⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 connectionexception.java

📁 Town是一个100% 纯Java API
💻 JAVA
字号:
package com.workingdogs.town;

import java.io.*;
import java.sql.*;

/*
Town, a Java JDBC abstraction layer
Copyright (C) 1999  Serge Knystautas, Jon Stevens

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Library General Public License for more details.

You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA  02111-1307, USA.
*/
/**
This wraps a SQLException.  This extends IOException so that servlets can
use the ConnectionException as if it was a SQLException, but are not required
to catch it (as servlets throw IOException automatically).

@author Jon S. Stevens <A HREF="mailto:jon@working-dogs.com">jon@working-dogs.com</A>
@author Serge Knystautas <a href="mailto:sergek@lokitech.com">sergek@lokitech.com</a>
@version 1.0
*/
public class ConnectionException extends IOException
{
    /**
     * @serial parent the parent exception
     */
    Exception parent = null;
    public ConnectionException ()
    {
        super ();
    }
    /**
      * This method was created in VisualAge.
      * @param sqle SQLException
      */
    public ConnectionException(Exception e)
    {
        parent = e;
    }
    public ConnectionException (String s)
    {
        super (s);
    }
    /**
      * This method was created in VisualAge.
      * @param sqle SQLException
      */
    public ConnectionException(SQLException sqle)
    {
        parent = sqle;
    }
    public Throwable fillInStackTrace ()
    {
        if (parent != null)
            return parent.fillInStackTrace ();
        else
            return super.fillInStackTrace ();
    }
    public String getLocalizedMessage ()
    {
        if (parent != null)
            return parent.getLocalizedMessage ();
        else
            return super.getLocalizedMessage ();
    }
    public String getMessage ()
    {
        if (parent != null)
            return parent.getMessage ();
        else
            return super.getMessage ();
    }
    public void printStackTrace ()
    {
        if (parent != null)
            parent.printStackTrace ();
        else
            super.printStackTrace ();
    }
    public void printStackTrace (PrintStream s)
    {
        if (parent != null)
            parent.printStackTrace (s);
        else
            super.printStackTrace (s);
    }
    public void printStackTrace (PrintWriter s)
    {
        if (parent != null)
            parent.printStackTrace (s);
        else
            super.printStackTrace (s);
    }
    public String toString ()
    {
        if (parent != null)
            return "ConnectionException: " + parent.toString ();
        else
            return super.toString ();
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -