Response title
This is preview!
Click on Join Now to Sign Up
try {
Object oResult = ExecutorService.getInstance().getExecutor(database).queryForObject(new RawSqlStatement(this.getSql().replaceFirst(";$", "")), String.class);
String result = oResult.toString();
if (result == null) {
throw new PreconditionFailedException("No rows returned from SQL Precondition", changeLog, this);
} else {
try {
String result = (String)ExecutorService.getInstance().getExecutor(database).queryForObject(new RawSqlStatement(this.getSql().replaceFirst(";$", "")), String.class);
if (result == null) {
throw new PreconditionFailedException("No rows returned from SQL Precondition", changeLog, this);
} else {
String expectedResult = this.getExpectedResult();
if (!expectedResult.equals(result)) {
throw new PreconditionFailedException("SQL Precondition failed. Expected '" + expectedResult + "' got '" + result + "'", changeLog, this);
}
}