com.rapidminer.operator.io
Class DatabaseExampleSetWriter

java.lang.Object
  extended by com.rapidminer.operator.Operator
      extended by com.rapidminer.operator.io.AbstractWriter<ExampleSet>
          extended by com.rapidminer.operator.io.AbstractExampleSetWriter
              extended by com.rapidminer.operator.io.DatabaseExampleSetWriter
All Implemented Interfaces:
ConfigurationListener, PreviewListener, ParameterHandler, LoggingHandler

public class DatabaseExampleSetWriter
extends AbstractExampleSetWriter

This operator writes an ExampleSet into an SQL database. The user can specify the database connection and a table name. Please note that the table will be created during writing if it does not exist.

The most convenient way of defining the necessary parameters is the configuration wizard. The most important parameters (database URL and user name) will be automatically determined by this wizard. At the end, you only have to define the table name and then you are ready.

This operator only supports the writing of the complete example set consisting of all regular and special attributes and all examples. If this is not desired perform some preprocessing operators like attribute or example filter before applying this operator.

Author:
Ingo Mierswa

Field Summary
static java.lang.String PARAMETER_DATABASE_SYSTEM
          The parameter name for "Indicates the used database system"
static java.lang.String PARAMETER_DATABASE_URL
          The parameter name for "The complete URL connection string for the database, e.g.
static java.lang.String PARAMETER_DEFAULT_VARCHAR_LENGTH
          The parameter name for "Default length of varchar columns.
static java.lang.String PARAMETER_OVERWRITE_MODE
          The parameter name for "Indicates if an existing table should be overwritten.
static java.lang.String PARAMETER_PASSWORD
          The parameter name for "Password for the database.
static java.lang.String PARAMETER_SET_DEFAULT_VARCHAR_LENGTH
          The parameter name for "Set varchar columns to default length.
static java.lang.String PARAMETER_TABLE_NAME
          The parameter name for "Use this table if work_on_database is true or no other query is specified.
static java.lang.String PARAMETER_USERNAME
          The parameter name for "Database username.
 
Constructor Summary
DatabaseExampleSetWriter(OperatorDescription description)
           
 
Method Summary
protected  DatabaseHandler getConnectedDatabaseHandler()
           
 java.util.List<ParameterType> getParameterTypes()
          Returns a list of ParameterTypes describing the parameters of this operator.
 ExampleSet write(ExampleSet exampleSet)
          Creates (or reads) the ExampleSet that will be returned by AbstractWriter.apply().
 
Methods inherited from class com.rapidminer.operator.io.AbstractWriter
apply, getInputClasses, getOutputClasses
 
Methods inherited from class com.rapidminer.operator.Operator
addError, addValue, addWarning, apply, checkDeprecations, checkForStop, checkIO, checkProperties, clearErrorList, cloneOperator, createExperimentTree, createExperimentTree, createFromXML, createMarkedExperimentTree, createMarkedProcessTree, createProcessTree, createProcessTree, getAddOnlyAdditionalOutput, getApplyCount, getDeliveredOutputClasses, getDeprecationInfo, getDesiredInputClasses, getEncoding, getErrorList, getExperiment, getInnerOperatorsXML, getInput, getInput, getInput, getInputDescription, getIOContainerForInApplyLoopBreakpoint, getIODescription, getLog, getName, getOperatorClassName, getOperatorDescription, getParameter, getParameterAsBoolean, getParameterAsColor, getParameterAsDouble, getParameterAsFile, getParameterAsFile, getParameterAsInputStream, getParameterAsInt, getParameterAsMatrix, getParameterAsString, getParameterList, getParameters, getParameterType, getParent, getProcess, getStartTime, getStatus, getUserDescription, getValue, getValues, getXML, hasBreakpoint, hasBreakpoint, hasInput, inApplyLoop, isDebugMode, isEnabled, isExpanded, isParallel, isParameterSet, log, logError, logNote, logWarning, performAdditionalChecks, processFinished, processStarts, register, registerOperator, remove, rename, resume, setApplyCount, setBreakpoint, setEnabled, setExpanded, setInput, setListParameter, setOperatorParameters, setParameter, setParameters, setParent, setUserDescription, toString, unregisterOperator, writeXML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_DATABASE_SYSTEM

public static final java.lang.String PARAMETER_DATABASE_SYSTEM
The parameter name for "Indicates the used database system"

See Also:
Constant Field Values

PARAMETER_DATABASE_URL

public static final java.lang.String PARAMETER_DATABASE_URL
The parameter name for "The complete URL connection string for the database, e.g. 'jdbc:mysql://foo.bar:portnr/database'"

See Also:
Constant Field Values

PARAMETER_USERNAME

public static final java.lang.String PARAMETER_USERNAME
The parameter name for "Database username."

See Also:
Constant Field Values

PARAMETER_PASSWORD

public static final java.lang.String PARAMETER_PASSWORD
The parameter name for "Password for the database."

See Also:
Constant Field Values

PARAMETER_TABLE_NAME

public static final java.lang.String PARAMETER_TABLE_NAME
The parameter name for "Use this table if work_on_database is true or no other query is specified."

See Also:
Constant Field Values

PARAMETER_OVERWRITE_MODE

public static final java.lang.String PARAMETER_OVERWRITE_MODE
The parameter name for "Indicates if an existing table should be overwritten."

See Also:
Constant Field Values

PARAMETER_SET_DEFAULT_VARCHAR_LENGTH

public static final java.lang.String PARAMETER_SET_DEFAULT_VARCHAR_LENGTH
The parameter name for "Set varchar columns to default length."

See Also:
Constant Field Values

PARAMETER_DEFAULT_VARCHAR_LENGTH

public static final java.lang.String PARAMETER_DEFAULT_VARCHAR_LENGTH
The parameter name for "Default length of varchar columns."

See Also:
Constant Field Values
Constructor Detail

DatabaseExampleSetWriter

public DatabaseExampleSetWriter(OperatorDescription description)
Method Detail

write

public ExampleSet write(ExampleSet exampleSet)
                 throws OperatorException
Description copied from class: AbstractWriter
Creates (or reads) the ExampleSet that will be returned by AbstractWriter.apply().

Specified by:
write in class AbstractWriter<ExampleSet>
Returns:
the written IOObject itself
Throws:
OperatorException

getConnectedDatabaseHandler

protected DatabaseHandler getConnectedDatabaseHandler()
                                               throws OperatorException,
                                                      java.sql.SQLException
Throws:
OperatorException
java.sql.SQLException

getParameterTypes

public java.util.List<ParameterType> getParameterTypes()
Description copied from class: Operator
Returns a list of ParameterTypes describing the parameters of this operator. The default implementation returns an empty list if no input objects can be retained and special parameters for those input objects which can be prevented from being consumed.

Specified by:
getParameterTypes in interface ParameterHandler
Overrides:
getParameterTypes in class Operator


Copyright © 2001-2009 by Rapid-I