Package weka.core.converters
Class DatabaseConnection
java.lang.Object
weka.experiment.DatabaseUtils
weka.core.converters.DatabaseConnection
- All Implemented Interfaces:
Serializable
,RevisionHandler
Connects to a database.
- Version:
- $Revision: 8034 $
- Author:
- Len Trigg (trigg@cs.waikato.ac.nz), Stefan Mutter (mutter@cs.waikato.ac.nz)
- See Also:
-
Field Summary
Fields inherited from class weka.experiment.DatabaseUtils
BOOL, BYTE, DATE, DOUBLE, EXP_INDEX_TABLE, EXP_RESULT_COL, EXP_RESULT_PREFIX, EXP_SETUP_COL, EXP_TYPE_COL, FLOAT, INTEGER, LONG, PROPERTY_FILE, SHORT, STRING, TEXT, TIME, TIMESTAMP
-
Constructor Summary
ConstructorDescriptionSets up the database drivers.DatabaseConnection
(File propsFile) Reads the properties from the specified file and sets up the database drivers.DatabaseConnection
(Properties props) Uses the specified properties to set up the database drivers. -
Method Summary
Modifier and TypeMethodDescriptionGets meta data for the database connection object.Returns the underlying properties object.Returns the revision string.int
Dewtermines if the current query retrieves a result set or updates a tableboolean
Check if the property checkUpperCaseNames in the DatabaseUtils file is set to true or false.Methods inherited from class weka.experiment.DatabaseUtils
arrayToString, attributeCaseFix, close, close, connectToDatabase, createExperimentIndex, createExperimentIndexEntry, createResultsTable, databaseURLTipText, debugTipText, disconnectFromDatabase, execute, experimentIndexExists, getDatabaseURL, getDebug, getKeywords, getKeywordsMaskChar, getPassword, getResultFromTable, getResultSet, getResultsTableName, getSupportedCursorScrollType, getUsername, initialize, initialize, isConnected, isCursorScrollable, isCursorScrollSensitive, isKeyword, maskKeyword, passwordTipText, processKeyString, putResultInTable, select, setDatabaseURL, setDebug, setKeywords, setKeywordsMaskChar, setPassword, setUsername, tableExists, translateDBColumnType, typeName, update, usernameTipText
-
Constructor Details
-
DatabaseConnection
Sets up the database drivers.- Throws:
Exception
- if an error occurs
-
DatabaseConnection
Reads the properties from the specified file and sets up the database drivers.- Parameters:
propsFile
- the props file to load, ignored if null or pointing to a directory- Throws:
Exception
- if an error occurs
-
DatabaseConnection
Uses the specified properties to set up the database drivers.- Parameters:
props
- the properties to use, ignored if null- Throws:
Exception
- if an error occurs
-
-
Method Details
-
getProperties
Returns the underlying properties object.- Returns:
- the properties object
-
getUpperCase
public boolean getUpperCase()Check if the property checkUpperCaseNames in the DatabaseUtils file is set to true or false.- Returns:
- true if the property checkUpperCaseNames in the DatabaseUtils file is set to true, false otherwise.
-
getMetaData
Gets meta data for the database connection object.- Returns:
- the meta data.
- Throws:
Exception
- if an error occurs
-
getUpdateCount
Dewtermines if the current query retrieves a result set or updates a table- Returns:
- the update count (-1 if the query retrieves a result set).
- Throws:
SQLException
- if an error occurs
-
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classDatabaseUtils
- Returns:
- the revision
-