Package weka.core.converters

Examples of weka.core.converters.DatabaseLoader


    }
    add(db,BorderLayout.SOUTH);
  }
 
  private boolean resetAndUpdateDatabaseLoaderIfChanged() {
    DatabaseLoader dbl = (DatabaseLoader)m_dsLoader.getLoader();
    String url = dbl.getUrl();
    String user = dbl.getUser();
    String password = dbl.getPassword();
    String query = dbl.getQuery();
    String keys = dbl.getKeys();
   
    boolean update = (!url.equals(m_dbaseURLText.getText()) ||
        !user.equals(m_userNameText.getText()) ||
        !password.equals(m_passwordText.getText()) ||
        !query.equalsIgnoreCase(m_queryText.getText())||
        !keys.equals(m_keyText.getText()));
   
    if (update) {
      dbl.resetStructure()
      dbl.setUrl(m_dbaseURLText.getText());
      dbl.setUser(m_userNameText.getText());
      dbl.setPassword(new String(m_passwordText.getPassword()));
      dbl.setQuery(m_queryText.getText());
      dbl.setKeys(m_keyText.getText());
    }
   
    return update;
  }
View Full Code Here


    buffer.append("Loder Class: " + loader.getLoader().getClass().getName()  + "\n");
    buffer.append("Global Info: " + loader.globalInfo()  + "\n");
    String className = loader.getLoader().getClass().getName();
   
    if(className.equalsIgnoreCase(DatabaseLoader.class.getName())) {
      DatabaseLoader databaseLoader = (DatabaseLoader)loader.getLoader();
           
      buffer.append("  Loader type: DatabaseLoader"  + "\n");
      buffer.append("Options: ");
      String[] options = databaseLoader.getOptions();   
      for(int i = 0; i < options.length; i++) {
        buffer.append(options[i] + "; ");
      }
      buffer.append("  URL: " + databaseLoader.getUrl() + "\n");
      buffer.append("  User: " + databaseLoader.getUser() + "\n");   
      buffer.append("  Password: " + "?" + "\n")
      buffer.append("  Query: " + databaseLoader.getQuery() + "\n");
      buffer.append("  Key columns' name: " + databaseLoader.getKeys() + "\n");       
    }
    else if(className.equalsIgnoreCase(ArffLoader.class.getName())) {
      ArffLoader arffLoader = (ArffLoader)loader.getLoader();
      buffer.append("  Loader type: ArffLoader" + "\n");
    }
View Full Code Here

    for(int i = 0; i < loaders.size(); i++) {
      Loader loader = (Loader)loaders.get(i);           
      String className = loader.getLoader().getClass().getName();
     
      if(className.equalsIgnoreCase(DatabaseLoader.class.getName())) {
        DatabaseLoader databaseLoader = (DatabaseLoader)loader.getLoader();
        if(env.getOutConnection() != null) {
          databaseLoader.setSource(env.getInConnection());
        }
      } else if(className.equalsIgnoreCase(ArffLoader.class.getName())) {
        ArffLoader arffLoader = (ArffLoader)loader.getLoader();
        // setup operation goes here
      } else if(className.equalsIgnoreCase(CSVLoader.class.getName())) {
View Full Code Here

    if (query == null) {
      query = "";
    }
   
    try {
      DatabaseLoader dbl = new DatabaseLoader();
      dbl.setUser(user);
      dbl.setPassword(password);
      dbl.setUrl(uRL);
      dbl.setQuery(query);
     
      BeanContextSupport bc = new BeanContextSupport();
      bc.setDesignTime(true);
     
      Loader loaderComp = new Loader();
View Full Code Here

    }
    add(holderP, BorderLayout.SOUTH);
  }
 
  private boolean resetAndUpdateDatabaseLoaderIfChanged() {
    DatabaseLoader dbl = (DatabaseLoader)m_dsLoader.getLoader();
    String url = dbl.getUrl();
    String user = dbl.getUser();
    String password = dbl.getPassword();
    String query = dbl.getQuery();
    String keys = dbl.getKeys();
    File propsFile = dbl.getCustomPropsFile();
   
    boolean update = (!url.equals(m_dbaseURLText.getText()) ||
        !user.equals(m_userNameText.getText()) ||
        !password.equals(m_passwordText.getText()) ||
        !query.equalsIgnoreCase(m_queryText.getText())||
        !keys.equals(m_keyText.getText()));
   
    if (propsFile != null && m_dbProps.getText().length() > 0) {
       update = (update || !propsFile.toString().equals(m_dbProps.getText()));       
    } else {
      update = (update || m_dbProps.getText().length() > 0);
    }
   
    if (update) {
      dbl.resetStructure()
      dbl.setUrl(m_dbaseURLText.getText());
      dbl.setUser(m_userNameText.getText());
      dbl.setPassword(new String(m_passwordText.getPassword()));
      dbl.setQuery(m_queryText.getText());
      dbl.setKeys(m_keyText.getText());
      if (m_dbProps.getText() != null && m_dbProps.getText().length() > 0) {
        dbl.setCustomPropsFile(new File(m_dbProps.getText()));
      }
    }
   
    return update;
  }
View Full Code Here

TOP

Related Classes of weka.core.converters.DatabaseLoader

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.