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

📄 daoexception.java

📁 分页类,包括中文和英文及其他语言种类,便于二次开发及商业开发,
💻 JAVA
字号:
package com.laoer.comm.db;

import java.io.PrintStream;

/**
 * <p>Title: 天乙软件工作室公共包</p>
 * <p>Description: 天乙软件工作室公共包</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: 天乙软件工作室[LAOER.COM/TIANYISOFT.NET]</p>
 * @author 龚天乙(Laoer)
 * @version 1.0
 */

public class DAOException
    extends Exception {

  protected Exception exception;
  protected boolean fatal;

  public DAOException() {
    super();
  }

  public DAOException(String p0) {
    super(p0);
  }

  public DAOException(Throwable p0) {
    super(p0);
  }

  public DAOException(String p0, Throwable p1) {
    super(p0, p1);
  }

  public DAOException(Exception e) {
    this(e, e.getMessage());
  }

  public DAOException(Exception e, String message) {
    super(message);
    this.exception = e;
  }

  public DAOException(Exception e, String message, boolean fatal) {
    this(e, message);
    setFatal(fatal);
  }

  public boolean isFatal() {
    return this.fatal;
  }

  public void setFatal(boolean fatal) {
    this.fatal = fatal;
  }

  public void printStackTrace() {
    super.printStackTrace();
    if (this.exception != null) {
      System.out.print("%%%% wrapped exception: ");
      this.exception.printStackTrace();
    }
  }

  public void printStackTrace(PrintStream printStream) {
    super.printStackTrace(printStream);
    if (this.exception != null) {
      System.out.print("%%%% wrapped exception: ");
      this.exception.printStackTrace(printStream);
    }
  }

  public String toString() {
    if (exception != null) {
      return super.toString() + " wraps: [" + exception.toString() + "]";
    }
    else {
      return super.toString();
    }
  }

}

⌨️ 快捷键说明

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