code: private void writeKML(ProgressVisitor progress) throws SQLException {
          FileOutputStream fos = null;
          try {
              fos = new FileOutputStream(fileName);
              writeKMLDocument(progress, fos);
          } catch (FileNotFoundException ex) {
              throw new SQLException(ex);
  
          } finally {
              try {
                  if (fos != null) {
                      fos.close();
                  }
              } catch (IOException ex) {
                  throw new SQLException(ex);
              }
          }
      }
docs: Write the spatial table to a KML format
  
  @param progress
  @throws SQLException