1 package com.protomatter.jdbc.pool; 2 3 52 53 import java.io.*; 54 import java.sql.*; 55 56 61 public class PoolSQLException 62 extends SQLException 63 { 64 private Exception exception = null; 65 66 public PoolSQLException() 67 { 68 super(); 69 } 70 71 public PoolSQLException(String message) 72 { 73 super(message); 74 } 75 76 public PoolSQLException(String message, Exception x) 77 { 78 super(message); 79 this.exception = x; 80 } 81 82 public Exception getException() 83 { 84 return this.exception; 85 } 86 87 public void printStackTrace() 88 { 89 StringWriter sw = new StringWriter(); 90 PrintWriter w = new PrintWriter(sw); 91 printStackTrace(w); 92 w.close(); 93 System.err.println(sw.toString()); 94 } 95 96 public void printStackTrace(PrintWriter w) 97 { 98 super.printStackTrace(w); 99 if (exception != null) 100 { 101 w.print("Masks exception: "); 102 w.println(exception.toString()); 103 exception.printStackTrace(w); 104 } 105 } 106 } 107 | Popular Tags |