@Override
    public void add(Integer id, String type) {
        try {
            connection = getConnection();
            ptmt = connection.prepareStatement("INSERT INTO User_types(id_user, type) VALUES(?,?);");
            ptmt.setInt(1, id);
            ptmt.setString(2, type);
            ptmt.executeUpdate();
        } catch (SQLException ex) {
            Logger.getLogger(UserTypesDAO.class.getName()).log(Level.SEVERE, null, ex);
        } finally {
            try {
                if (ptmt != null) {
                    ptmt.close();
                }
                if (connection != null) {
                    connection.close();
                }
                if (resultSet != null) {
                    resultSet.close();
                }
            } catch (SQLException ex) {
                Logger.getLogger(UserTypesDAO.class.getName()).log(Level.SEVERE, null, ex);
            }

        }
    }