public void updateRecord(Record in) throws SQLException
   {
      // First get the format number
      int formatNumber = in.getFormat().save();

      // Get the new category number
      int catNum = in.getCategory().save();

      // Add the record itself
      updateRecord.setString(1, in.getTitle());
      updateRecord.setDate(2, new java.sql.Date(in.getDate().getTime().getTime()));
      updateRecord.setInt(3, formatNumber);
      updateRecord.setString(4, in.getNotes());
      updateRecord.setInt(5, in.getReleaseYear());
      updateRecord.setInt(6, catNum);
      updateRecord.setString(7, in.getAuthor());
      updateRecord.setInt(8, in.getReleaseMonth());
      updateRecord.setInt(9, in.getReleaseType());
      updateRecord.setInt(10, in.getOwner());
      updateRecord.setDouble(11, in.getPrice());
      updateRecord.setInt(12, in.getShelfPos());
      updateRecord.setString(13, in.getRiploc());
      updateRecord.setInt(14, in.getDiscogsNum());
      updateRecord.setInt(15, in.getParent());
      updateRecord.setInt(17, in.getNumber());
      updateRecord.setDouble(16, in.getSoldPrice());

      updateRecord.execute();
      int recordNumber = in.getNumber();

      // Delete the label numbers
      PreparedStatement ps = Connect.getConnection().getPreparedStatement(
            "DELETE FROM LabelSet WHERE RecordNumber = ?");
      ps.setInt(1, recordNumber);
      ps.execute();

      // Get the label numbers
      int[] labNums = new int[in.getLabels().size()];
      int labPointer = 0;
      for (Label lab : in.getLabels())
         labNums[labPointer++] = lab.save();

      for (int labNum : labNums)
      {
         // Add the numbers to the label set
         PreparedStatement lps = Connect.getConnection().getPreparedStatement(
               "INSERT INTO LabelSet (RecordNumber,LabelNumber) VALUES (?,?)");
         lps.setInt(1, recordNumber);
         lps.setInt(2, labNum);
         lps.execute();
      }

      // Delete the catalogue numbers
      PreparedStatement lps = Connect.getConnection().getPreparedStatement(
            "DELETE FROM CatNoSet WHERE RecordNumber = ?");
      lps.setInt(1, recordNumber);
      lps.execute();

      // Add the catalogue numbers
      Iterator<String> cIt = in.getCatNos().iterator();
      while (cIt.hasNext())
      {
         String catNo = cIt.next();
         PreparedStatement llps = Connect.getConnection().getPreparedStatement(
               "INSERT INTO CatNoSet (RecordNumber,CatNo) VALUES (?,?)");
         llps.setInt(1, recordNumber);
         llps.setString(2, catNo);
         llps.execute();
      }

      // Deal with the tracks
      for (Track t : in.getTracks())
         t.save(in.getNumber());

      // Delete any miscreant tracks
      PreparedStatement dps = Connect.getConnection().getPreparedStatement(
            "DELETE FROM Track WHERE recordnumber = ? AND tracknumber > ?");
      dps.setInt(1, in.getNumber());
      dps.setInt(2, in.getTracks().size());
      dps.execute();

   }