@Override public void writeIncremental(Instance inst) throws IOException {
  int writeMode=getWriteMode();
  Instances structure=getInstances();
  if (m_DataBaseConnection == null) {
    throw new IOException("No database has been set up.");
  }
  if (getRetrieval() == BATCH) {
    throw new IOException("Batch and incremental saving cannot be mixed.");
  }
  setRetrieval(INCREMENTAL);
  try {
    if (!m_DataBaseConnection.isConnected()) {
      connectToDatabase();
    }
    if (writeMode == WAIT) {
      if (structure == null) {
        setWriteMode(CANCEL);
        if (inst != null) {
          throw new Exception("Structure(Header Information) has to be set in advance");
        }
      }
 else {
        setWriteMode(STRUCTURE_READY);
      }
      writeMode=getWriteMode();
    }
    if (writeMode == CANCEL) {
      cancel();
    }
    if (writeMode == STRUCTURE_READY) {
      setWriteMode(WRITE);
      writeStructure();
      writeMode=getWriteMode();
    }
    if (writeMode == WRITE) {
      if (structure == null) {
        throw new IOException("No instances information available.");
      }
      if (inst != null) {
        writeInstance(inst);
      }
 else {
        m_DataBaseConnection.disconnectFromDatabase();
        resetStructure();
        m_count=1;
      }
    }
  }
 catch (  Exception ex) {
    printException(ex);
  }
}

@ Override public void writeIncremental ( Instance inst ) throws IOException { int writeMode = getWriteMode ( ) ; Instances structure = getInstances ( ) ; if ( m_DataBaseConnection == null ) { throw new IOException ( "No database has been set up." ) ; } if ( getRetrieval ( ) == BATCH ) { throw new IOException ( "Batch and incremental saving cannot be mixed." ) ; } setRetrieval ( INCREMENTAL ) ; try { if ( ! m_DataBaseConnection . isConnected ( ) ) { connectToDatabase ( ) ; } if ( writeMode == WAIT ) { if ( structure == null ) { setWriteMode ( CANCEL ) ; if ( inst != null ) { throw new Exception ( "Structure(Header Information) has to be set in advance" ) ; } } else { setWriteMode ( STRUCTURE_READY ) ; } writeMode = getWriteMode ( ) ; } if ( writeMode == CANCEL ) { cancel ( ) ; } if ( writeMode == STRUCTURE_READY ) { setWriteMode ( WRITE ) ; writeStructure ( ) ; writeMode = getWriteMode ( ) ; } if ( writeMode == WRITE ) { if ( structure == null ) { throw new IOException ( "No instances information available." ) ; } if ( inst != null ) { writeInstance ( inst ) ; } else { m_DataBaseConnection . disconnectFromDatabase ( ) ; resetStructure ( ) ; m_count = 1 ; } } } catch ( Exception ex ) { printException ( ex ) ; } }
saves an instances incrementally . structure has to be set by using the setstructure ( ) method or setinstances ( ) method . when a structure is set , a table is created .
