use of org.knime.core.node.port.database.DatabaseUtility in project knime-core by knime.
the class ParameterizedDBQueryPanel method loadSettingsFrom.
void loadSettingsFrom(final NodeSettingsRO settings, final PortObjectSpec[] specs, final Collection<FlowVariable> flowVariables) {
try {
m_appendInputColsModel.loadSettingsFrom(settings);
m_includeEmptyResultsModel.loadSettingsFrom(settings);
m_retainAllColumnsModel.loadSettingsFrom(settings);
m_failIfExceptionModel.loadSettingsFrom(settings);
m_editor.setText(settings.getString(ParameterizedDBQueryNodeModel.CFG_SQL_STATEMENT, ParameterizedDBQueryNodeModel.getDefaultSQLStatement()));
} catch (InvalidSettingsException ex) {
m_appendInputColsModel.setBooleanValue(ParameterizedDBQueryNodeModel.DEF_APPEND_INPUT_COL);
m_includeEmptyResultsModel.setBooleanValue(ParameterizedDBQueryNodeModel.DEF_INCLUDE_EMPTY_RESULTS);
m_retainAllColumnsModel.setBooleanValue(ParameterizedDBQueryNodeModel.DEF_RETAIN_ALL_COLUMNS);
m_failIfExceptionModel.setBooleanValue(ParameterizedDBQueryNodeModel.DEF_FAIL_IF_EXCEPTION);
}
updateKnimeColumns((DataTableSpec) specs[0]);
updateDBColumns(((DatabasePortObjectSpec) specs[1]).getDataTableSpec());
updateFlowVariables(flowVariables.toArray(new FlowVariable[flowVariables.size()]));
if (specs[1] != null && specs[1] instanceof DatabasePortObjectSpec) {
final DatabasePortObjectSpec dbSpec = (DatabasePortObjectSpec) specs[1];
final DatabaseUtility dbUtility = DatabaseUtility.getUtility(dbSpec.getDatabaseIdentifier());
m_statementManipulator = dbUtility.getStatementManipulator();
}
}
Aggregations