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

📄 exceptionmanager.java

📁 一个基于java工厂模式的 的实现
💻 JAVA
字号:
/*
 * ExceptionHandler.java
 *
 * Created on 2007年4月17日, 下午4:07
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package com.ebuy.dataaccess;

import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintStream;
import java.io.PrintWriter;

/**
 *
 * @author Administrator
 */
public class ExceptionManager
{
    
    /** Creates a new instance of ExceptionHandler */
    public ExceptionManager()
    {
    }
    public static void handlerException(Exception ex)
    {
        try
        {
           // FileWriter fw=new FileWriter("c://error.log");
            PrintWriter pw=new PrintWriter("c://error.log");
            ex.printStackTrace(pw);
            pw.flush();
            pw.close();
        } 
        catch (IOException e)
        {
            
        }
    }
    
}

⌨️ 快捷键说明

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