I'd like to check if an SQL statement is a query or an update/insert/delete before I actually execute the statement. Right now I'm doing this:

```
if (stmt.execute(sqlStatement)) {
    // Deal with queries
}
else {
    // Deal with updates/inserts/deletes
}

```

where stmt is a Java Statement.

The problem is that I need to perform some SQL logic only before updates/inserts/deletes to the table but not before queries.