1 21 package net.sf.hajdbc; 22 23 30 public class SQLException extends java.sql.SQLException 31 { 32 private static final long serialVersionUID = 4122254034733510710L; 33 34 38 public SQLException(String message) 39 { 40 super(message); 41 } 42 43 48 public SQLException(String message, Throwable cause) 49 { 50 super(message); 51 52 this.initCause(cause); 53 } 54 55 59 public SQLException(Throwable cause) 60 { 61 super(cause.toString()); 62 63 this.initCause(cause); 64 } 65 66 69 @Override 70 public int getErrorCode() 71 { 72 Throwable cause = this.getCause(); 73 74 if ((cause != null) && java.sql.SQLException .class.isInstance(cause)) 75 { 76 return java.sql.SQLException .class.cast(cause).getErrorCode(); 77 } 78 79 return super.getErrorCode(); 80 } 81 82 85 @Override 86 public java.sql.SQLException getNextException() 87 { 88 Throwable cause = this.getCause(); 89 90 if ((cause != null) && java.sql.SQLException .class.isInstance(cause)) 91 { 92 return java.sql.SQLException .class.cast(cause).getNextException(); 93 } 94 95 return super.getNextException(); 96 } 97 98 101 @Override 102 public String getSQLState() 103 { 104 Throwable cause = this.getCause(); 105 106 if ((cause != null) && java.sql.SQLException .class.isInstance(cause)) 107 { 108 return java.sql.SQLException .class.cast(cause).getSQLState(); 109 } 110 111 return super.getSQLState(); 112 } 113 } 114 | Popular Tags |