Static Public Member Functions | |
SQLException | getSQLException (SQLException sqlEx, String cjdbcMessage) |
SQLException | getSQLException (List exceptions, String cjdbcMessage) |
Definition at line 36 of file SQLExceptionFactory.java.
|
creates a new SQLException with the cjdbcMessage, if all exceptions in the list have the same errorcode and sqlstate the returned SQLExcepion will be constructed with this values otherwise with null and 0
Definition at line 64 of file SQLExceptionFactory.java. 00066 { 00067 String sqlState = null; 00068 int errorCode = 0; 00069 for (int i = 0; i < exceptions.size(); i++) 00070 { 00071 SQLException ex = (SQLException) exceptions.get(i); 00072 cjdbcMessage += ex.getMessage() + "\n"; 00073 if (i == 0) 00074 { 00075 //first exception 00076 sqlState = ex.getSQLState(); 00077 errorCode = ex.getErrorCode(); 00078 } 00079 else 00080 { 00081 //make sure sqlState is the same for all backends 00082 if (sqlState != null && !sqlState.equals(ex.getSQLState())) 00083 sqlState = null; 00084 //make sure the error code is the same for all backends 00085 if (errorCode != ex.getErrorCode()) 00086 errorCode = 0; 00087 } 00088 } 00089 return new SQLException(cjdbcMessage, sqlState, errorCode); 00090 }
|
|
creates a new SQLException with the cjdbcMessage
Definition at line 46 of file SQLExceptionFactory.java. 00048 { 00049 SQLException newException = new SQLException(cjdbcMessage, sqlEx 00050 .getSQLState(), sqlEx.getErrorCode()); 00051 newException.setNextException(sqlEx); 00052 return newException; 00053 }
|