code: private void writeKMZ(ProgressVisitor progress, String fileNameWithExtension) throws SQLException {
          ZipOutputStream zos = null;
          try {
              zos = new ZipOutputStream(new FileOutputStream(fileName));
              // Create a zip entry for the main KML file
              zos.putNextEntry(new ZipEntry(fileNameWithExtension));
              writeKMLDocument(progress, zos);
          } catch (FileNotFoundException ex) {
              throw new SQLException(ex);
          } catch (IOException ex) {
              throw new SQLException(ex);
          } finally {
              try {
                  if (zos != null) {
                      zos.closeEntry();
                      zos.finish();
                  }
              } catch (IOException ex) {
                  throw new SQLException(ex);
              } finally {
                  try {
                      if (zos != null) {
                          zos.close();
                      }
                  } catch (IOException ex) {
                      throw new SQLException(ex);
                  }
              }
          }
  
  
      }
docs: Write the spatial table to a KMZ format
  
  @param progress
  @param fileNameWithExtension
  @throws SQLException