private String[] getSQLCommandStructure(String SQL_COMMAND) {
        String SQL_COMMAND_STRUCTURE = "", Single_Quoted_String_value, Double_Quoted_String_value, Number_value, End_char, Variable_name, Variable_value, DATA_TYPE;
        String[] SQL_COMMAND_STRUCTURE_VARIABLES = new String[1000];
        Matcher existMatch = null;
        Pattern p = null;
        int existMatchStart = 0, existMatchEnd = 0, existMatchEndOld = 0, i = 0;


        int VariableNumber, GlobalVariableNumber;

        Single_Quoted_String_value = "$SINGLE_QUOTED_STRING_";
        Double_Quoted_String_value = "$DOUBLE_QUOTED_STRING_";
        Number_value = "$NUMBER_";
        End_char = "$";

        //see http://dev.mysql.com/doc/refman/5.0/en/identifiers.html for MySQL Schema Object Names
        //see http://dev.mysql.com/doc/refman/5.0/en/string-syntax.html for MySQL Strings
        //see http://www.regular-expressions.info/examplesprogrammer.html for some util regexp

        /*
        //remove CR LF
        SQL_COMMAND = SQL_COMMAND.replaceAll("\r\n", " ");
        SQL_COMMAND = SQL_COMMAND.replaceAll("\n", " ");
        SQL_COMMAND = SQL_COMMAND.replaceAll("\r", " ");
        
        //convert to lower case
        SQL_COMMAND=SQL_COMMAND.toLowerCase();
         */

        GlobalVariableNumber = 1;
        //Convert quoted strings into $SINGLE_QUOTED_STRING_X$
        VariableNumber = 1;
        existMatchEndOld = 0;
        SQL_COMMAND_STRUCTURE = "";
        p = Pattern.compile("'[^']*(?:''*)*'", Pattern.CASE_INSENSITIVE);// look for quoted Strings in the query. Quoted strings may have a ''
        existMatch = p.matcher(SQL_COMMAND);
        while (existMatch.find()) {
            existMatchStart = existMatch.start();
            existMatchEnd = existMatch.end();
            Variable_name = Single_Quoted_String_value + VariableNumber + End_char;
            Variable_value = SQL_COMMAND.substring(existMatchStart + 1, existMatchEnd - 1);
            SQL_COMMAND_STRUCTURE = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld, existMatchStart) + Variable_name;
            existMatchEndOld = existMatchEnd;
            VariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_name;
            GlobalVariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_value;
            GlobalVariableNumber++;
            DATA_TYPE = "CHAR";
            try {
                float f = Float.parseFloat(Variable_value);
                DATA_TYPE = "NUMERIC";
            } catch (Throwable e) {
            }
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = DATA_TYPE;
            GlobalVariableNumber++;
        }
        SQL_COMMAND = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld);

        //Convert double quoted strings into $DOUBLE_QUOTED_STRING_X$
        VariableNumber = 1;
        existMatchEndOld = 0;
        SQL_COMMAND_STRUCTURE = "";
        p = Pattern.compile("\"[^\"]*(?:\"\"*)*'", Pattern.CASE_INSENSITIVE);// look for double quoted Strings in the query. Double quoted strings may have a ""
        existMatch = p.matcher(SQL_COMMAND);
        while (existMatch.find()) {
            existMatchStart = existMatch.start();
            existMatchEnd = existMatch.end();
            Variable_name = Double_Quoted_String_value + VariableNumber + End_char;
            Variable_value = SQL_COMMAND.substring(existMatchStart + 1, existMatchEnd - 1);
            SQL_COMMAND_STRUCTURE = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld, existMatchStart) + Variable_name;
            existMatchEndOld = existMatchEnd;
            VariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_name;
            GlobalVariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_value;
            GlobalVariableNumber++;
            DATA_TYPE = "CHAR";
            try {
                float f = Float.parseFloat(Variable_value);
                DATA_TYPE = "NUMERIC";
            } catch (Throwable e) {
            }
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = DATA_TYPE;
            GlobalVariableNumber++;
        }
        SQL_COMMAND = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld);

        //Convert numbers into $NUMBER_X$
        VariableNumber = 1;
        existMatchEndOld = 0;
        SQL_COMMAND_STRUCTURE = "";
        p = Pattern.compile("\\b\\d+\\b", Pattern.CASE_INSENSITIVE);// look for numbers in the query. Numbers inside strings are ommited
        existMatch = p.matcher(SQL_COMMAND);
        while (existMatch.find()) {
            existMatchStart = existMatch.start();
            existMatchEnd = existMatch.end();
            Variable_name = Number_value + VariableNumber + End_char;
            Variable_value = SQL_COMMAND.substring(existMatchStart, existMatchEnd);
            SQL_COMMAND_STRUCTURE = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld, existMatchStart) + Variable_name;
            existMatchEndOld = existMatchEnd;
            VariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_name;
            GlobalVariableNumber++;
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = Variable_value;
            GlobalVariableNumber++;
            DATA_TYPE = "CHAR";
            try {
                float f = Float.parseFloat(Variable_value);
                DATA_TYPE = "NUMERIC";
            } catch (Throwable e) {
            }
            SQL_COMMAND_STRUCTURE_VARIABLES[GlobalVariableNumber] = DATA_TYPE;
            GlobalVariableNumber++;
        }
        SQL_COMMAND_STRUCTURE = SQL_COMMAND_STRUCTURE + SQL_COMMAND.substring(existMatchEndOld);
        SQL_COMMAND_STRUCTURE_VARIABLES[0] = SQL_COMMAND_STRUCTURE;

        String[] Result = new String[GlobalVariableNumber];

        i = 0;
        for (i = 0; i < GlobalVariableNumber; i++) {
            Result[i] = SQL_COMMAND_STRUCTURE_VARIABLES[i];
        }
        return Result;
    }