SqlTypeChecker { public static boolean isInsertSql(String sourceSql) { return StringHelper.removeXMLCdataTag(SqlParseHelper.removeSqlComments(sourceSql)).trim().toLowerCase().matches("(?is)\\s*insert\\s+into\\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_isInsertSql() throws Throwable{ String sourceSql = "insert into userinfo (user) values (?)"; boolean result = sqlTypeChecker.isInsertSql(sourceSql ); assertTrue(result); assertTrue(sqlTypeChecker.isInsertSql("<![CDATA[ insert into userinfo (user) values (?) ]]>" )); result = sqlTypeChecker.isInsertSql("sinsert into userinfo (user) values (?)" ); assertFalse(result); System.out.println(Boolean.class); }