diff --git a/src/main/java/weaver/micro/devkit/DatabaseRuntimeException.java b/src/main/java/weaver/micro/devkit/DatabaseRuntimeException.java new file mode 100644 index 0000000..e7076ec --- /dev/null +++ b/src/main/java/weaver/micro/devkit/DatabaseRuntimeException.java @@ -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); + } + +} diff --git a/src/main/java/weaver/micro/devkit/handler/StrictRecordSet.java b/src/main/java/weaver/micro/devkit/handler/StrictRecordSet.java new file mode 100644 index 0000000..74ab071 --- /dev/null +++ b/src/main/java/weaver/micro/devkit/handler/StrictRecordSet.java @@ -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 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; + } + +}