Thursday, 6 October 2016

java - How to check certain words on a string?

    if (c.getQuery().contains("update") || c.getQuery().contains("delete") || c.getQuery().contains("truncate")
|| c.getQuery().contains("drop")) {
throw new MensagemException(Mensagens.getMensagem("Only select is allowed"));



I have this simple code, that checks the string query. But it only checks lower case, what can I do to make it also verify any upper case without writing this over and over?

No comments:

Post a Comment

c++ - Does curly brackets matter for empty constructor?

Those brackets declare an empty, inline constructor. In that case, with them, the constructor does exist, it merely does nothing more than t...