Skip to content

Commit 6e0d266

Browse files
add executeAndIgnore method
1 parent 902f5ea commit 6e0d266

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

sqldev/src/test/java/org/utplsql/sqldev/test/AbstractJdbcTest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import java.util.List;
2222
import java.util.Properties;
2323

24+
import org.springframework.jdbc.BadSqlGrammarException;
2425
import org.springframework.jdbc.core.JdbcTemplate;
2526
import org.springframework.jdbc.datasource.SingleConnectionDataSource;
2627
import org.utplsql.sqldev.exception.GenericRuntimeException;
@@ -73,4 +74,12 @@ public static List<String> getStatements(final String sqlplusScript) {
7374
}
7475
return stmts;
7576
}
77+
78+
public static void executeAndIgnore(JdbcTemplate template, String sql) {
79+
try {
80+
template.execute(sql);
81+
} catch (BadSqlGrammarException e) {
82+
// ignore
83+
}
84+
}
7685
}

0 commit comments

Comments
 (0)