use of net.sourceforge.sqlexplorer.sqlpanel.SQLExecution in project tdq-studio-se by Talend.
the class ExecSQLAction method run.
protected void run(int maxRows) {
Session session = getSession();
if (session == null)
return;
QueryParser qt = session.getDatabaseProduct().getQueryParser(_editor.getSQLToBeExecuted(), _editor.getSQLLineNumber());
try {
qt.parse();
} catch (final ParserException e) {
_editor.getSite().getShell().getDisplay().asyncExec(new Runnable() {
public void run() {
MessageDialog.openError(_editor.getSite().getShell(), Messages.getString("SQLResultsView.Error.Title"), e.getMessage());
}
});
}
if (qt.iterator().hasNext()) {
boolean clearResults = SQLExplorerPlugin.getDefault().getPreferenceStore().getBoolean(IConstants.CLEAR_RESULTS_ON_EXECUTE);
if (clearResults)
_editor.clearResults();
AbstractSQLExecution job = new SQLExecution(_editor, qt, maxRows);
job.schedule();
}
}
Aggregations