1 24 25 package org.objectweb.cjdbc.common.exceptions; 26 27 import java.io.PrintStream ; 28 import java.io.PrintWriter ; 29 import java.io.Serializable ; 30 31 37 public class CJDBCException extends Exception implements Serializable 38 { 39 private static final long serialVersionUID = -1899348090329064503L; 40 41 42 protected Throwable cause; 43 44 47 public CJDBCException() 48 { 49 } 50 51 56 public CJDBCException(String message) 57 { 58 super(message); 59 } 60 61 66 public CJDBCException(Throwable cause) 67 { 68 this.cause = cause; 69 } 70 71 77 public CJDBCException(String message, Throwable cause) 78 { 79 super(message); 80 this.cause = cause; 81 } 82 83 88 public Throwable getCause() 89 { 90 return cause; 91 } 92 93 96 public synchronized Throwable fillInStackTrace() 97 { 98 if (cause != null) 99 { 100 return cause.fillInStackTrace(); 101 } 102 else 103 { 104 return super.fillInStackTrace(); 105 } 106 } 107 108 111 public StackTraceElement [] getStackTrace() 112 { 113 if (cause != null) 114 { 115 return cause.getStackTrace(); 116 } 117 else 118 { 119 return super.getStackTrace(); 120 } 121 } 122 123 126 public String getMessage() 127 { 128 if (cause != null) 129 { 130 return cause.getMessage(); 131 } 132 else 133 { 134 return super.getMessage(); 135 } 136 } 137 138 141 public void printStackTrace() 142 { 143 if (cause != null) 144 { 145 cause.printStackTrace(); 146 } 147 else 148 { 149 super.printStackTrace(); 150 } 151 } 152 153 156 public void printStackTrace(PrintStream arg0) 157 { 158 if (cause != null) 159 { 160 cause.printStackTrace(arg0); 161 } 162 else 163 { 164 super.printStackTrace(arg0); 165 } 166 } 167 168 171 public void printStackTrace(PrintWriter arg0) 172 { 173 if (cause != null) 174 { 175 cause.printStackTrace(arg0); 176 } 177 else 178 { 179 super.printStackTrace(arg0); 180 } 181 } 182 183 186 public void setStackTrace(StackTraceElement [] arg0) 187 { 188 if (cause != null) 189 { 190 cause.setStackTrace(arg0); 191 } 192 else 193 { 194 super.setStackTrace(arg0); 195 } 196 } 197 198 } 199 | Popular Tags |