SqlTypeChecker { public static boolean isUpdateSql(String sourceSql) { return StringHelper.removeXMLCdataTag(SqlParseHelper.removeSqlComments(sourceSql)).trim().toLowerCase().matches("(?is)\\s*update\\s+.*\\sset\\s.*"); }  static boolean isSelectSql(String sourceSql); static boolean isUpdateSql(String sourceSql); static boolean isDeleteSql(String sourceSql); static boolean isInsertSql(String sourceSql);  }
@Test public void test_isUpdateSql() throws Throwable{ boolean result = sqlTypeChecker.isUpdateSql("update user set username = ? ,abc = ? where id = ?" ); assertTrue(result); assertTrue(sqlTypeChecker.isUpdateSql("<![CDATA[ update user set username = ? ,abc = ? where id = ? ]]>" )); assertFalse(sqlTypeChecker.isUpdateSql("select usr_id,usr_name,usr_passwd,usr_type,usr_gmt_create,usr_gmt_update from tse_user_base" )); }