I need to define is my query is DDL or DML. To do this i need to try to find out part of strings like "create" "update" etc. in another string (my query).
My strings:
"CreATE table test (id number);"
"sElECT * from user;"
"ALTER table;"
Can someone tell me how to return true if string contains "create / select / alter" and also ignore lower and uppercase?
I tried that:
Pattern.compile(Pattern.quote(query), Pattern.CASE_INSENSITIVE).matcher("CREATE").find())
but it sometimes works and sometimes not, i think this is bad way to achieve my goal.