weka.gui.sql
Class DbUtils

java.lang.Object
  extended by weka.experiment.DatabaseUtils
      extended by weka.gui.sql.DbUtils
All Implemented Interfaces:
java.io.Serializable

public class DbUtils
extends DatabaseUtils

A little bit extended DatabaseUtils class.

Note: needs at least HSQLDB 1.7.3.3 to work, older versions do not support Cursors that can also move backwards - see execute(String).

Version:
$Revision: 1.2 $
Author:
FracPete (fracpete at waikato dot ac dot nz)
See Also:
DatabaseUtils, execute(String), Serialized Form

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
 
Constructor Summary
DbUtils()
          initializes the object
 
Method Summary
 boolean execute(java.lang.String query)
          Executes a SQL query.
 java.sql.Connection getConnection()
          returns the current database connection
 
Methods inherited from class weka.experiment.DatabaseUtils
arrayToString, close, close, connectToDatabase, createExperimentIndex, createExperimentIndexEntry, createResultsTable, databaseURLTipText, debugTipText, disconnectFromDatabase, experimentIndexExists, getDatabaseURL, getDebug, getPassword, getResultFromTable, getResultSet, getResultsTableName, getUsername, isConnected, passwordTipText, processKeyString, putResultInTable, select, setDatabaseURL, setDebug, setPassword, setUsername, tableExists, translateDBColumnType, typeName, update, usernameTipText
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DbUtils

public DbUtils()
        throws java.lang.Exception
initializes the object

Throws:
java.lang.Exception - in case something goes wrong in the init of the DatabaseUtils constructor
See Also:
DatabaseUtils
Method Detail

execute

public boolean execute(java.lang.String query)
                throws java.sql.SQLException
Executes a SQL query. Modified to allow forward and backward scrolling.

Overrides:
execute in class DatabaseUtils
Parameters:
query - the SQL query
Returns:
true if the query generated results
Throws:
java.sql.SQLException - if an error occurs
See Also:
DatabaseUtils.close()

getConnection

public java.sql.Connection getConnection()
returns the current database connection

Returns:
the current connection instance