@@ -0,0 +1,1036 @@
+package com.infogen.sql;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0Aimport java.util.regex.Pattern;%0A%0A/**%0A * @author larry%0A * @version %E5%88%9B%E5%BB%BA%E6%97%B6%E9%97%B4 2018%E5%B9%B43%E6%9C%881%E6%97%A5 %E4%B8%8B%E5%8D%884:59:50%0A */%0Apublic class SqlValidation %7B%0A%09// %E5%88%A4%E6%96%AD%E6%98%AF%E5%90%A6%E5%AD%98%E5%9C%A8sql%E6%B3%A8%E5%85%A5%0A%09public static Boolean is_sql_safety(String string) %7B%0A%09%09return Regular(string, %22%5E%5B_0-9a-zA-Z%5C%5Cu4e00-%5C%5Cu9fa5%5D%7B1,32%7D$%22);%0A%09%7D%0A%0A%09public static String%5B%5D is_sql_safety(String%5B%5D item_array) %7B%0A%09%09List%3CString%3E return_list = new ArrayList%3C%3E();%0A%09%09for (int i = 0; i %3C item_array.length; i++) %7B%0A%09%09%09String string = item_array%5Bi%5D;%0A%0A%09%09%09if (Regular(string, %22%5E%5B_0-9a-zA-Z%5C%5Cu4e00-%5C%5Cu9fa5%5D%7B1,32%7D$%22)) %7B%0A%09%09%09%09return_list.add(string);%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return return_list.toArray(new String%5B%5D %7B%7D);%0A%09%7D%0A%0A%09/**%0A%09 * %E5%8C%B9%E9%85%8D%E6%98%AF%E5%90%A6%E7%AC%A6%E5%90%88%E6%AD%A3%E5%88%99%E8%A1%A8%E8%BE%BE%E5%BC%8Fpattern %E5%8C%B9%E9%85%8D%E8%BF%94%E5%9B%9Etrue%0A%09 * %0A%09 * @param str%0A%09 *            %E5%8C%B9%E9%85%8D%E7%9A%84%E5%AD%97%E7%AC%A6%E4%B8%B2%0A%09 * @param pattern%0A%09 *            %E5%8C%B9%E9%85%8D%E6%A8%A1%E5%BC%8F%0A%09 * @return Boolean%0A%09 */%0A%09private static Boolean Regular(String string, String pattern) %7B%0A%09%09if (null == string %7C%7C string.trim().length() %3C= 0) %7B%0A%09%09%09return false;%0A%09%09%7D%0A%09%09return Pattern.compile(pattern).matcher(string).matches();%0A%09%7D%0A%7D%0A

update sql