protected void processRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {


        // *** process data ***

        // [DATA] retreive values
        Map<String, String[]> req = request.getParameterMap();
        // [CONV]
        ConvertData<Integer, String> intConv = new ConvertData<Integer, String>() {

            @Override
            public Integer convert(String data) {
                throw new UnsupportedOperationException("Not supported yet.");
            }

            @Override
            public Integer[] convert(String[] data) {
                Integer[] intArr = new Integer[data.length];
                for (int i = 0; i < intArr.length; i++) {
                    intArr[i] = Integer.getInteger(data[i]);
                }
                return intArr;
            }
        };
        ConvertData<java.sql.Date, String> sqlDateConv = new ConvertData<java.sql.Date, String>() {

            @Override
            public Date convert(String data) {
                throw new UnsupportedOperationException("Not supported yet.");
            }

            @Override
            public Date[] convert(String[] data) {
                java.sql.Date[] dateArr = new java.sql.Date[data.length];

                for (int i = 0; i < dateArr.length; i++) {
                    dateArr[i] = new java.sql.Date(Long.parseLong(data[i]));
                }

                return dateArr;
            }
        };
        // [VALD]
        ValidateData lenVald = new ValidateData() {

            @Override
            public boolean isValid(Map<String, Array<? extends Object>> data) {
                String[] keys = (String[]) data.keySet().toArray();

                int len = data.get(keys[0]).length();
                for (int i = 1; i < keys.length; i++) {
                    int tempLen = data.get(keys[i]).length();
                    if (len != tempLen) {
                        return false;
                    }
                }
                return true;
            }

            @Override
            public String getLog() {
                return "INFO: no log kept";
            }
        };
        // [PARAMS]
        String[] groups = {"creditor", "debitor", "amount", "type", "date"};
        ConvertData[] convs = {intConv, intConv, intConv, intConv, sqlDateConv};
        ValidateData[] valds = {lenVald};

        // [DP]
        DataProcessor dp = new DataProcessor(req, groups, convs, valds);
        // [RESDATA]
        Map<String, Array<?>> resData = dp.getProcessedData();
        if (resData == null) {
            sendResponse(response, StatusCode.GENERIC_FAIL, dp.getLog());
            return;
        }

        // *** database connection ***
        Connection con = MySQLConnection.getConnection("jdbc:mysql://localhost:3306/gemsdb", "gems", "gems");

        //Statement stm = con.createStatement();


        /*
        try {
        // establish connection
        Connection con = null;
        Statement stm = null;
        try {
        Class.forName("com.mysql.jdbc.Driver");

        con = DriverManager.getConnection("jdbc:mysql://localhost:3306/gemsdb", "gems", "gems");
        stm = con.createStatement();
        } catch (ClassNotFoundException e) {
        status = 0;
        e.printStackTrace();
        }


        // sql operations

        if (status != 0) {
        String INSERT_TRANSACTION = "";

        for (int i = 0; i < len; i++) {
        INSERT_TRANSACTION = "INSERT INTO  gemsdb.`transaction` VALUES ( null, " + creditor[i] + "," + debitor[i] + "," + amount[i] + "," + type[i] + ",'" + date[i].toString() + "')";

        stm.execute(INSERT_TRANSACTION);

        //status = stm.execute(INSERT_TRANSACTION) ? 1 : 0;
        //System.out.println(INSERT_TRANSACTION);
        }
        }
        } catch (SQLException e) {
        }




        try {
        out.println("<root>");
        out.println("<status>" + status + "</status>");
        out.println("<message></message>");
        out.println("</root>");
        } finally {
        out.close();
        }

        // close connection
        con.close();

        }
        finally

        {
        out.close();
        }
         */
    }