@Override
    public boolean execute(String input) {

        String a, date, charge, chargeCategory;
        a = input.substring(input.indexOf(" "),input.length());
        date = a.substring(a.indexOf(" ") + 1, a.indexOf(";"));
        charge = a.substring(a.indexOf(";")+1,a.indexOf(":"));
        chargeCategory = a.substring(a.indexOf(":") + 1, a.length());

        java.sql.Date sqlDate = getSqlDate(date);
        if (sqlDate==null) {
            return false;
        }
        int chargeInt = getIntValue(charge);
        if (chargeInt==-1)   {
            return  false;
        }
        boolean getCategory = validationCategory(chargeCategory);
        if (!getCategory)   {
            return false;
        }

        System.out.println(a);
        System.out.println(date);
        System.out.println(charge);
        System.out.println(chargeCategory);

        Statement statement = null;

        try {
            statement = connection.createStatement();
            String query = "insert into CHARGES (DATE, CHARGES, CATEGORY) values " +
                    "('"+sqlDate+"'," +
                    ""+charge+"," +
                    " '"+chargeCategory+"')";
            statement.executeUpdate(query);

        } catch (SQLException e) {
            e.printStackTrace();
            return false;
        }  finally {
            if(statement != null){
                try {
                    statement.close();
                } catch (SQLException e) {
                    e.printStackTrace();
                }
            }
        }

        System.out.println("Показания приняты");
        return true;
    }