X-Git-Url: http://git.phpeclipse.com diff --git a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java index 755f9be..a7a84fe 100644 --- a/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java +++ b/archive/net.sourceforge.phpeclipse.quantum.sql/src/com/quantum/wizards/BaseSQLPage.java @@ -8,6 +8,7 @@ import com.quantum.model.Column; import com.quantum.model.ConnectionException; import com.quantum.model.Entity; import com.quantum.model.NotConnectedException; +import com.quantum.sql.SQLResults; import com.quantum.sql.TableRow; import com.quantum.view.ViewHelper; import com.quantum.view.tableview.TableAdapter; @@ -15,7 +16,8 @@ import com.quantum.view.tableview.TableAdapter; import org.eclipse.jface.wizard.WizardPage; /** - * @author BC + * @author BC Holmes + * @author Sirkware */ public abstract class BaseSQLPage extends WizardPage implements SQLPage { @@ -26,15 +28,18 @@ public abstract class BaseSQLPage extends WizardPage implements SQLPage { super(pageName); } public boolean performFinish() { - try { - Bookmark bookmark = this.adapter.getBookmark(); - bookmark.addQuery(getQueryText()); - ViewHelper.tryGetResults(getShell(), bookmark.getConnection(), getQueryText()); - } catch (ConnectionException e) { - e.printStackTrace(); - } - return true; - } + try { + Bookmark bookmark = this.adapter.getBookmark(); + bookmark.addQuery(getQueryText()); + SQLResults sqlResults = ViewHelper.tryGetResults(getShell(), + bookmark.getConnection(), getQueryText()); + return sqlResults.isError() ? false : true; + } catch (ConnectionException e) { + e.printStackTrace(); + return false; + } + } + protected abstract String getQueryText(); protected void appendColumn(StringBuffer whereClause, Entity entity, String columnName, DatabaseAdapter adapter, String value) {