Quantum version 2.4.1
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / view / ViewHelper.java
index e460e44..252c0a8 100644 (file)
@@ -12,6 +12,7 @@ import java.sql.SQLException;
 
 import com.quantum.Messages;
 import com.quantum.QuantumPlugin;
+import com.quantum.model.Bookmark;
 import com.quantum.sql.MultiSQLServer;
 import com.quantum.sql.SQLResults;
 
@@ -27,23 +28,22 @@ import org.eclipse.ui.IViewPart;
  */
 public class ViewHelper {
 
-       public static SQLResults tryGetResults(IViewPart view, Connection con, String query) {
-               return tryGetResults(view.getSite().getShell(), con, query);
+       /** @deprecated */
+       public static SQLResults tryGetResults(IViewPart view, Bookmark bookmark, Connection con, String query) {
+               return tryGetResults(view.getSite().getShell(), bookmark, con, query);
        }
 
-       public static SQLResults tryGetResults(Shell shell, Connection con, String query) {
-               SQLResults results = null;      
-               MultiSQLServer server = MultiSQLServer.getInstance();
+       /** @deprecated */
+       public static SQLResults tryGetResults(Shell shell, Bookmark bookmark, Connection con, String query) {
                try {
-                       results = server.execute(con, query);
+                       MultiSQLServer server = MultiSQLServer.getInstance();
+                       return server.execute(bookmark, con, query);
                } catch (SQLException e) {
                        LogProxy log = LogProxy.getInstance();
                        log.addText(LogProxy.ERROR, e.getLocalizedMessage(), e); //$NON-NLS-1$ //$NON-NLS-2$
-                       results = new SQLResults();
-                       results.setIsError(true);
                        MessageDialog.openConfirm(shell, "Database returned error", e.getLocalizedMessage());  //$NON-NLS-1$                                                    
+                       return null;
                }
-               return results;
        }
        
        public static FileOutputStream askSaveFile(String key, Shell shell) {