/** * Queries a database to load results from the specified table name. The * database connection must have already made by m_InstanceQuery. * * @param tableName the name of the table containing results to retrieve. */ protected void setInstancesFromDatabaseTable(String tableName) { try { m_FromLab.setText("Reading from database, please wait..."); final Instances i = m_InstanceQuery.retrieveInstances("SELECT * FROM " + tableName); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { setInstances(i); } }); m_InstanceQuery.disconnectFromDatabase(); } catch (Exception ex) { m_FromLab.setText(ex.getMessage()); } }
/** * Queries a database to load results from the specified table name. The * database connection must have already made by m_InstanceQuery. * * @param tableName the name of the table containing results to retrieve. */ protected void setInstancesFromDatabaseTable(String tableName) { try { m_FromLab.setText("Reading from database, please wait..."); final Instances i = m_InstanceQuery.retrieveInstances("SELECT * FROM " + tableName); SwingUtilities.invokeAndWait(new Runnable() { @Override public void run() { setInstances(i); } }); m_InstanceQuery.disconnectFromDatabase(); } catch (Exception ex) { m_FromLab.setText(ex.getMessage()); } }
@Override public void run() { try { m_Log.statusMessage("Reading from database..."); final Instances i = iq.retrieveInstances(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { setInstances(new Instances(i)); } }); iq.disconnectFromDatabase(); } catch (Exception ex) { m_Log.statusMessage("Problem executing DB query " + m_SQLQ); JOptionPane.showMessageDialog(PreprocessPanel.this, "Couldn't read from database:\n" + ex.getMessage(), "Load Instances", JOptionPane.ERROR_MESSAGE); } m_IOThread = null; } };
@Override public void run() { try { m_Log.statusMessage("Reading from database..."); final Instances i = iq.retrieveInstances(); SwingUtilities.invokeAndWait(new Runnable() { public void run() { setInstances(new Instances(i)); } }); iq.disconnectFromDatabase(); } catch (Exception ex) { m_Log.statusMessage("Problem executing DB query " + m_SQLQ); JOptionPane.showMessageDialog(PreprocessPanel.this, "Couldn't read from database:\n" + ex.getMessage(), "Load Instances", JOptionPane.ERROR_MESSAGE); } m_IOThread = null; } };
System.err.println("not found"); m_FromLab.setText("No experiment index"); m_InstanceQuery.disconnectFromDatabase(); return; if (index.numInstances() == 0) { m_FromLab.setText("No experiments available"); m_InstanceQuery.disconnectFromDatabase(); return; m_InstanceQuery.disconnectFromDatabase(); return;
System.err.println("not found"); m_FromLab.setText("No experiment index"); m_InstanceQuery.disconnectFromDatabase(); return; if (index.numInstances() == 0) { m_FromLab.setText("No experiments available"); m_InstanceQuery.disconnectFromDatabase(); return; m_InstanceQuery.disconnectFromDatabase(); return;