@Override
    public String findById(int id) {
        String type = null;
        try {
            connection = getConnection();
            ptmt = connection.prepareStatement("SELECT id FROM Task WHERE type=?;");
            ptmt.setInt(1, id);
            resultSet = ptmt.executeQuery();
            resultSet.next();
            type = resultSet.getString("type");
        } 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);
            }

        }
        return type;
    }