exportsqlinfo.java

来自「这是一本描述JDBC数据库的书籍」· Java 代码 · 共 50 行

JAVA
50
字号
/* * ExportException.java * * Created on June 11, 2005, 12:06 AM * * To change this template, choose Tools | Options and locate the template under * the Source Creation and Management node. Right-click the template and choose * Open. You can then make changes to the template in the Source Editor. */package ch03;import java.sql.*;/** * * @author kevin */public class ExportSQLInfo {            public static void showSQLException(SQLException e){        if(e == null) return;        System.out.println("ErrorCode\t" + e.getErrorCode() +"\n");        System.out.println("SQLStatus\t" + e.getSQLState() + "\n");        System.out.println("Message  \t" + e.getMessage()  + "\n");        System.out.println("LocalizeMessage\t" + e.getLocalizedMessage() +"\n");        e.printStackTrace();        SQLException nextException = e.getNextException();        showSQLException(nextException);    }        public static void showSQLWarning(SQLWarning w){        if(w == null) return;        System.out.println("ErrorCode\t" + w.getErrorCode() +"\n");        System.out.println("SQLStatus\t" + w.getSQLState() + "\n");        System.out.println("Message  \t" + w.getMessage()  + "\n");        System.out.println("LocalizeMessage\t" + w.getLocalizedMessage() +"\n");                SQLWarning nextWarning = w.getNextWarning();        showSQLWarning(nextWarning);    }}

⌨️ 快捷键说明

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