I’m writing a program that executes different sql statements(query, dml, ddl, dcl). How can I determine that executed statement(method boolean Statement#execute(String s)) was ddl or dcl. I know how to determine a query. Statement was a query when execute() method return true, when statement#execute() return value is false then it can be dml, ddl or dcl. So how to determine type of statement?
I’m writing a program that executes different sql statements(query, dml, ddl, dcl). How can
Share
The presence of a result (
execute()== true) does not necessarily indicate a query. e.g. in PostgreSQL a DELETE statement can also return a result (when using thereturningclause).To process all results or update counts of a statement, you need to implement a loop that follows the guidelines documented with the Javadocs of
getMoreResults():