1 22 package org.jboss.resource.adapter.jdbc.vendor; 23 24 import java.io.Serializable ; 25 import java.sql.SQLException ; 26 import org.jboss.resource.adapter.jdbc.ExceptionSorter; 27 28 29 37 public class MySQLExceptionSorter implements ExceptionSorter, Serializable 38 { 39 private static final long serialVersionUID = 2375890129763721017L; 40 41 public boolean isExceptionFatal(SQLException e) 42 { 43 if (e.getSQLState() != null) 44 { if (e.getSQLState().startsWith("08")) 46 { 47 return true; 48 } 49 } 50 switch (e.getErrorCode()) 51 { 52 case 1040: case 1042: case 1043: case 1047: case 1081: case 1129: case 1130: 61 case 1045: 64 case 1004: case 1005: case 1015: case 1021: case 1041: 71 case 1037: case 1038: 75 return true; 76 } 77 78 return false; 79 } 80 } 81 | Popular Tags |