|
|
@@ -5,8 +5,8 @@ import java.lang.reflect.InvocationTargetException;
|
|
|
import org.apache.ibatis.exceptions.PersistenceException;
|
|
|
|
|
|
import com.lc.ibps.base.core.exception.spi.AbstractSpiExceptionService;
|
|
|
-import com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException;
|
|
|
-
|
|
|
+//import com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException;
|
|
|
+import java.sql.SQLIntegrityConstraintViolationException;
|
|
|
import cn.hutool.core.util.ReUtil;
|
|
|
|
|
|
/**
|
|
|
@@ -66,8 +66,8 @@ public class SpiExceptionServicePersistenceException extends AbstractSpiExceptio
|
|
|
// "Table 'ibps_test_v2.8.10.t_zdyzb' doesn't exist"
|
|
|
InvocationTargetException itEx = (InvocationTargetException) mysqlseeCause;
|
|
|
Throwable te = itEx.getTargetException();
|
|
|
- if(te instanceof MySQLSyntaxErrorException) {
|
|
|
- MySQLSyntaxErrorException mysqlsee = (MySQLSyntaxErrorException) te;
|
|
|
+ if(te instanceof SQLIntegrityConstraintViolationException) {
|
|
|
+ SQLIntegrityConstraintViolationException mysqlsee = (SQLIntegrityConstraintViolationException) te;
|
|
|
int code = mysqlsee.getErrorCode();
|
|
|
if(1146 == code) {
|
|
|
error = mysqlsee.getMessage();
|
|
|
@@ -118,8 +118,8 @@ public class SpiExceptionServicePersistenceException extends AbstractSpiExceptio
|
|
|
// "Table 'ibps_test_v2.8.10.t_zdyzb' doesn't exist"
|
|
|
InvocationTargetException itEx = (InvocationTargetException) mysqlseeCause;
|
|
|
Throwable te = itEx.getTargetException();
|
|
|
- if(te instanceof MySQLSyntaxErrorException) {
|
|
|
- MySQLSyntaxErrorException mysqlsee = (MySQLSyntaxErrorException) te;
|
|
|
+ if(te instanceof SQLIntegrityConstraintViolationException) {
|
|
|
+ SQLIntegrityConstraintViolationException mysqlsee = (SQLIntegrityConstraintViolationException) te;
|
|
|
int code = mysqlsee.getErrorCode();
|
|
|
if(1146 == code) {
|
|
|
error = mysqlsee.getMessage();
|