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;
import org.eclipse.jface.wizard.WizardPage;
/**
- * @author BC
+ * @author BC Holmes
+ * @author Sirkware
*/
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) {