|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectweka.core.converters.AbstractSaver
weka.core.converters.DatabaseSaver
Writes to a database (tested with MySQL, InstantDB, HSQLDB). Available options are: -T
| Field Summary |
| Fields inherited from interface weka.core.converters.Saver |
BATCH, INCREMENTAL, NONE |
| Constructor Summary | |
DatabaseSaver()
Constructor |
|
| Method Summary | |
java.lang.String |
autoKeyGenerationTipText()
Returns the tip text fo this property |
void |
cancel()
Cancels the incremental saving process and tries to drop the table if the write mode is CANCEL. |
void |
connectToDatabase()
Opens a connection to the database |
boolean |
getAutoKeyGeneration()
Gets whether or not a primary key will be generated automatically |
java.lang.String[] |
getOptions()
Gets the setting |
boolean |
getRelationForTableName()
Gets whether or not the relation name is used as name of the table |
java.lang.String |
getTableName()
Gets the table's name |
java.lang.String |
getUrl()
Gets the database URL |
java.lang.String |
getUser()
Gets the database user |
java.lang.String |
globalInfo()
Returns a string describing this Saver |
java.util.Enumeration |
listOptions()
Lists the available options |
static void |
main(java.lang.String[] options)
Main method. |
java.lang.String |
passwordTipText()
Returns the tip text fo this property |
java.lang.String |
relationForTableNameTipText()
Returns the tip text fo this property |
void |
resetOptions()
Resets the Saver ready to save a new data set |
void |
setAutoKeyGeneration(boolean flag)
En/Dis-ables the automatic generation of a primary key |
void |
setDestination()
Sets the database url using the DatabaseUtils file |
void |
setDestination(java.lang.String url)
Sets the database url |
void |
setDestination(java.lang.String url,
java.lang.String userName,
java.lang.String password)
Sets the database url |
void |
setOptions(java.lang.String[] options)
Sets the options. |
void |
setPassword(java.lang.String password)
Sets the database password |
void |
setRelationForTableName(boolean flag)
En/Dis-ables that the relation name is used for the name of the table (default enabled). |
void |
setTableName(java.lang.String tn)
Sets the table's name |
void |
setUrl(java.lang.String url)
Sets the database URL |
void |
setUser(java.lang.String user)
Sets the database user |
java.lang.String |
tableNameTipText()
Returns the tip text fo this property |
java.lang.String |
urlTipText()
Returns the tip text fo this property |
java.lang.String |
userTipText()
Returns the tip text fo this property |
void |
writeBatch()
Writes a Batch of instances |
void |
writeIncremental(Instance inst)
Saves an instances incrementally. |
| Methods inherited from class weka.core.converters.AbstractSaver |
filePrefix, getFileExtension, getInstances, getWriteMode, resetStructure, retrieveDir, setDestination, setDestination, setDir, setDirAndPrefix, setFile, setFilePrefix, setInstances, setRetrieval, setStructure |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DatabaseSaver()
throws java.lang.Exception
java.lang.Exception - throws Exception if property file cannot be read| Method Detail |
public void resetOptions()
resetOptions in class AbstractSaverpublic void cancel()
cancel in class AbstractSaverpublic java.lang.String globalInfo()
public void setTableName(java.lang.String tn)
tn - the name of the tablepublic java.lang.String getTableName()
public java.lang.String tableNameTipText()
public void setAutoKeyGeneration(boolean flag)
public boolean getAutoKeyGeneration()
public java.lang.String autoKeyGenerationTipText()
public void setRelationForTableName(boolean flag)
public boolean getRelationForTableName()
public java.lang.String relationForTableNameTipText()
public void setUrl(java.lang.String url)
setUrl in interface DatabaseConverterpublic java.lang.String getUrl()
getUrl in interface DatabaseConverterpublic java.lang.String urlTipText()
public void setUser(java.lang.String user)
setUser in interface DatabaseConverterpublic java.lang.String getUser()
getUser in interface DatabaseConverterpublic java.lang.String userTipText()
public void setPassword(java.lang.String password)
setPassword in interface DatabaseConverterpublic java.lang.String passwordTipText()
public void setDestination(java.lang.String url,
java.lang.String userName,
java.lang.String password)
url - the database urluserName - the user namepassword - the passwordpublic void setDestination(java.lang.String url)
url - the database urlpublic void setDestination()
public void connectToDatabase()
public void writeIncremental(Instance inst) throws java.io.IOException
writeIncremental in interface SaverwriteIncremental in class AbstractSaverinst - the instance to save
java.io.IOException - throws IOEXception.
public void writeBatch()
throws java.io.IOException
writeBatch in interface SaverwriteBatch in class AbstractSaverjava.io.IOException - throws IOExceptionpublic java.lang.String[] getOptions()
getOptions in interface OptionHandlerpublic java.util.Enumeration listOptions()
listOptions in interface OptionHandler
public void setOptions(java.lang.String[] options)
throws java.lang.Exception
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||