better check for update queries

Check if a query needs to be executed with executeUpdate() or executeQuery() in a more flexible way.

It uses lowercase, trim and startsWith checks instead of uppercase and contains.