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

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

      NumberFormat nForm = NumberFormat.getInstance();
      nForm.setMaximumFractionDigits(2);
      nForm.setMinimumFractionDigits(2);

      // Add the record itself
      addRecord.setString(1, in.getTitle());
      addRecord.setDate(2, new java.sql.Date(in.getDate().getTime().getTime()));
      addRecord.setInt(3, formatNumber);
      addRecord.setString(4, in.getNotes());
      addRecord.setInt(5, in.getReleaseYear());
      addRecord.setInt(6, catNum);
      addRecord.setString(7, in.getAuthor());
      addRecord.setInt(8, in.getReleaseMonth());
      addRecord.setInt(9, in.getReleaseType());
      addRecord.setInt(10, in.getOwner());
      addRecord.setDouble(11, in.getPrice());
      addRecord.setInt(12, in.getDiscogsNum());
      addRecord.setInt(13, in.getParent());
      Connect.getConnection().executeStatement(addRecord);

      getRecord.setString(1, in.getTitle());
      getRecord.setDate(2, new java.sql.Date(in.getDate().getTime().getTime()));
      getRecord.setInt(3, formatNumber);
      getRecord.setString(4, in.getNotes());
      ResultSet rs = Connect.getConnection().executeQuery(getRecord);
      rs.next();
      int recordNumber = rs.getInt(1);

      rs.close();

      // 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 ps = Connect.getConnection().getPreparedStatement(
               "INSERT INTO LabelSet (RecordNumber,LabelNumber) VALUES (?,?)");
         ps.setInt(1, recordNumber);
         ps.setInt(2, labNum);
         ps.execute();
      }

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

      // Add the tracks
      Iterator<Track> tIt = in.getTracks().iterator();
      while (tIt.hasNext())
         addTrack(recordNumber, tIt.next());

      return recordNumber;
   }