1 28 29 package com.caucho.sql; 30 31 import com.caucho.util.ExceptionWrapper; 32 33 import java.sql.SQLException ; 34 35 38 public class SQLExceptionWrapper extends java.sql.SQLException 39 implements ExceptionWrapper { 40 private Throwable _rootCause; 41 42 45 public SQLExceptionWrapper(String message) 46 { 47 super(message); 48 } 49 50 56 public SQLExceptionWrapper(String message, Throwable e) 57 { 58 super(message); 59 60 _rootCause = e; 61 } 62 63 69 public SQLExceptionWrapper(Throwable e) 70 { 71 super(e.toString()); 72 73 _rootCause = e; 74 } 75 76 public static SQLException create(Throwable e) 77 { 78 if (e instanceof SQLException ) 79 return (SQLException ) e; 80 else 81 return new SQLExceptionWrapper(e); 82 } 83 84 87 public Throwable getRootCause() 88 { 89 return _rootCause; 90 } 91 92 95 public Throwable getCause() 96 { 97 return _rootCause; 98 } 99 } 100 | Popular Tags |