1 22 23 package org.jboss.resource.adapter.jdbc.vendor; 24 25 import java.io.Serializable ; 26 import java.sql.SQLException ; 27 28 import org.jboss.logging.Logger; 29 import org.jboss.resource.adapter.jdbc.ExceptionSorter; 30 31 41 public class DB2ExceptionSorter implements ExceptionSorter, Serializable 42 { 43 44 45 private static final Logger logger = Logger.getLogger(DB2ExceptionSorter.class); 46 47 48 private static final boolean trace = logger.isTraceEnabled(); 49 50 51 private static final long serialVersionUID = -4724550353693159378L; 52 53 public boolean isExceptionFatal(final SQLException e) 54 { 55 56 final int code = Math.abs(e.getErrorCode()); 57 boolean isFatal = false; 58 59 if(code == 4499) 60 { 61 isFatal = true; 62 } 63 64 if(trace) 65 { 66 logger.trace("Evaluated SQL error code " + code + " isException returned " + isFatal); 67 } 68 69 return isFatal; 70 71 } 72 73 74 } 75 | Popular Tags |