-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ feature(1.1.14): 新增 StrictRecordSet, 发生错误时不进行抑制
- Loading branch information
Showing
2 changed files
with
72 additions
and
0 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
src/main/java/weaver/micro/devkit/DatabaseRuntimeException.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package weaver.micro.devkit; | ||
|
||
public class DatabaseRuntimeException extends RuntimeException { | ||
|
||
public DatabaseRuntimeException() { | ||
super(); | ||
} | ||
|
||
public DatabaseRuntimeException(String message) { | ||
super(message); | ||
} | ||
|
||
public DatabaseRuntimeException(String message, Throwable cause) { | ||
super(message, cause); | ||
} | ||
|
||
public DatabaseRuntimeException(Throwable cause) { | ||
super(cause); | ||
} | ||
|
||
} |
51 changes: 51 additions & 0 deletions
51
src/main/java/weaver/micro/devkit/handler/StrictRecordSet.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
package weaver.micro.devkit.handler; | ||
|
||
import com.api.integration.util.ProcBean; | ||
import weaver.conn.RecordSet; | ||
import weaver.micro.devkit.DatabaseRuntimeException; | ||
|
||
import java.util.List; | ||
|
||
public class StrictRecordSet extends RecordSet { | ||
|
||
@Override | ||
public boolean executeProc(String s, String s1, String s2) { | ||
return $(super.executeProc(s, s1, s2)); | ||
} | ||
|
||
@Override | ||
public boolean executeProc2(String s, String s1, String s2) { | ||
return $(super.executeProc2(s, s1, s2)); | ||
} | ||
|
||
// public boolean executeProcNew(String s, String s1, List<ProcBean> list) { | ||
// return $(super.executeProcNew(s, s1, list)); | ||
// } | ||
|
||
@Override | ||
public boolean executeSql(String s, boolean b, String s1, boolean b1, Object... objects) { | ||
return $(super.executeSql(s, b, s1, b1, objects)); | ||
} | ||
|
||
// public boolean executeBatchSql(String s, List<?> list, String s1) { | ||
// return $(super.executeBatchSql(s, list, s1)); | ||
// } | ||
|
||
@Override | ||
public boolean executeSql(String s, String s1) { | ||
return $(super.executeSql(s, s1)); | ||
} | ||
|
||
@Override | ||
public boolean executeSqlWithDataSource(String s, String s1) { | ||
return $(super.executeSqlWithDataSource(s, s1)); | ||
} | ||
|
||
boolean $(boolean result) { | ||
if (!result) | ||
throw new DatabaseRuntimeException(this.getExceptionMsg()); | ||
|
||
return true; | ||
} | ||
|
||
} |
caae1e3
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#4 该提交的类中使用的方法在 2017 及之前版本中不兼容, 2.0 版本时该类会做出调整.