public int saveLineUp(LineUp lup) throws SQLException
   {
      // Initialise the return value
      Groop grp = lup.getGroop();

      // Check to see if this lineup already exists
      Collection<LineUp> currentLineups = grp.getLineUps();

      for (LineUp lineUp : currentLineups)
         if (lineUp.equals(lup) && lineUp.getLineUpNumber() >= 0)
            return lineUp.getLineUpNumber();

      // Add the lineup - step 1, add the lineup to get the lineup number
      PreparedStatement ps = Connect.getConnection().getPreparedStatement(
            "INSERT INTO lineup (groopnumber) VALUES (?)");
      ps.setInt(1, grp.getNumber());
      ps.execute();

      PreparedStatement psg = Connect.getConnection().getPreparedStatement(
            "SELECT lineupnumber FROM lineup ORDER BY lineupnumber DESC LIMIT 1");
      ResultSet rs = psg.executeQuery();

      if (!rs.next())
         return -1;
      int lineupNumber = rs.getInt(1);

      // Now add the details
      PreparedStatement psa = Connect.getConnection().getPreparedStatement(
            "INSERT INTO lineupdetails(lineupnumber,artistnumber) VALUES (?,?)");
      for (Artist art : lup.getArtists())
      {
         art.save();

         psa.setInt(1, lineupNumber);
         psa.setInt(2, art.getId());
         psa.execute();
      }

      return lineupNumber;
   }