陌上花开
等风来

 

int ret = -1;
try {
ret = tBuyerCodeApplyInfoService.insertTBuyerCodeApplyInfoBySelective(buyerCode);
} catch (Exception e) {
boolean find = false;
Throwable exception = e;
while (exception != null ) {
if(exception instanceof MySQLIntegrityConstraintViolationException){
find = true;
break;
} else {
exception = exception.getCause();
}
}
if(!find) {
throw e;
} else {
return "请勿重复提交";
}
}

posted on 2017-11-22 15:22  一步一步往上爬的瓜牛  阅读(311)  评论(0编辑  收藏  举报