Here you can find the source of printExceptions(OutputStream os, SQLException sqlEx)
Parameter | Description |
---|---|
os | The output stream to print to. |
sqlEx | The exception(s) to print. |
public static void printExceptions(OutputStream os, SQLException sqlEx)
//package com.java2s; //License from project: Apache License import java.io.OutputStream; import java.io.PrintWriter; import java.sql.SQLException; public class Main { /**/* w ww.ja v a 2 s . c o m*/ * * Print an exception, or series of exceptions to the designated output * stream. * * @param os * The output stream to print to. * @param sqlEx * The exception(s) to print. * * */ public static void printExceptions(OutputStream os, SQLException sqlEx) { PrintWriter pw = new PrintWriter(os, true); while (sqlEx != null) { pw.println("----------------------------------------------"); pw.println("ERROR CODE : " + sqlEx.getErrorCode()); pw.println("ERROR STATE: " + sqlEx.getSQLState()); sqlEx.printStackTrace(pw); sqlEx = sqlEx.getNextException(); } } }