code: public Integer addGroup(String nameOfGroup) {
          PreparedStatement queryStatement = null;
          ResultSet results = null;
  
          try (Connection sqlConnection = sqlService.getConnection()) {
              queryStatement = sqlConnection.prepareStatement(
                  "INSERT INTO " + Constants.DB_TABLE_GROUPS
                      + "(" + Constants.GROUPS_GROUP_NAME + ")"
                      + " VALUES (?)", PreparedStatement.RETURN_GENERATED_KEYS
              );
              queryStatement.setString(1, nameOfGroup);
              queryStatement.executeUpdate();
  
              // execute statement and get resultSet which will have the generated path ID as the first field
              results = queryStatement.getGeneratedKeys();
              int groupId = -1;
              if (results.next()) {
                  groupId = results.getInt(1);
              } else {
                  // something went wrong
                  throw new Exception("Could not add group");
              }
              return groupId;
          } catch (Exception e) {
              e.printStackTrace();
          } finally {
              try {
                  if (results != null) {
                      results.close();
                  }
              } catch (Exception e) {
              }
              try {
                  if (queryStatement != null) {
                      queryStatement.close();
                  }
              } catch (Exception e) {
              }
          }
  
          return null;
      }
docs: When passed in the name of the group, this creates a new entry for it in the table
  Afterwards, it gets the groupId for other purposes (ie to create overrides that correspond to this specific group)
  
  @param nameOfGroup name of group to add
  @return ID of group created