Example usage for weka.core.converters DatabaseConnection DatabaseConnection

List of usage examples for weka.core.converters DatabaseConnection DatabaseConnection

Introduction

In this page you can find the example usage for weka.core.converters DatabaseConnection DatabaseConnection.

Prototype

public DatabaseConnection() throws Exception 

Source Link

Document

Sets up the database drivers.

Usage

From source file:core.DatabaseSaverEx.java

License:Open Source License

/** 
 * Resets the Saver ready to save a new data set.
 *//*  w  w  w.  j  a  va  2s.  com*/
public void resetOptions() {

    super.resetOptions();
    setRetrieval(NONE);
    m_tableName = "";
    m_Username = "";
    m_Password = "";
    m_count = 1;
    m_id = false;
    m_tabName = true;
    try {
        if (m_DataBaseConnection != null && m_DataBaseConnection.isConnected())
            m_DataBaseConnection.disconnectFromDatabase();
        m_DataBaseConnection = new DatabaseConnection();
    } catch (Exception ex) {
        printException(ex);
    }
}

From source file:core.DatabaseSaverEx.java

License:Open Source License

/** 
 * Sets the database url./*from  w w w.j  ava  2 s  .c o m*/
 * 
 * @param url the database url
 * @param userName the user name
 * @param password the password
 */
public void setDestination(String url, String userName, String password) {

    try {
        m_DataBaseConnection = new DatabaseConnection();
        m_DataBaseConnection.setDatabaseURL(url);
        m_DataBaseConnection.setUsername(userName);
        m_DataBaseConnection.setPassword(password);
    } catch (Exception ex) {
        printException(ex);
    }
}

From source file:core.DatabaseSaverEx.java

License:Open Source License

/** 
 * Sets the database url.//  w w  w.  j a  v a  2  s .c om
 * 
 * @param url the database url
 */
public void setDestination(String url) {

    try {
        m_DataBaseConnection = new DatabaseConnection();
        m_DataBaseConnection.setDatabaseURL(url);
        m_DataBaseConnection.setUsername(m_Username);
        m_DataBaseConnection.setPassword(m_Password);
    } catch (Exception ex) {
        printException(ex);
    }
}

From source file:core.DatabaseSaverEx.java

License:Open Source License

/** Sets the database url using the DatabaseUtils file. */
public void setDestination() {

    try {/*from  w ww.j  a  v  a2 s .  c o  m*/
        m_DataBaseConnection = new DatabaseConnection();
        m_DataBaseConnection.setUsername(m_Username);
        m_DataBaseConnection.setPassword(m_Password);
    } catch (Exception ex) {
        printException(ex);
    }
}