latest quantum sources 2.3.2
[phpeclipse.git] / archive / net.sourceforge.phpeclipse.quantum.sql / src / com / quantum / sql / MultiSQLServer.java
index 4946bf6..ef233fb 100644 (file)
@@ -87,22 +87,6 @@ public class MultiSQLServer implements ConnectionEstablisher {
         }
     }
 
-    public Vector getSchemas(Connection con) {
-        ResultSet set;
-        Vector schemaList = new Vector();
-        try {
-            DatabaseMetaData meta = con.getMetaData();
-            set = meta.getSchemas();
-            while (set.next()) {
-                schemaList.add(set.getString("TABLE_SCHEM")); //$NON-NLS-1$
-            }
-            set.close();
-        } catch (SQLException e) {
-            LogProxy log = LogProxy.getInstance();
-            log.addText(LogProxy.ERROR, e);
-        }
-        return schemaList;
-    }
     /**
      * Makes a connection to a JDBC driver based on the data from a bookmark
      * @param bookmark - 
@@ -122,17 +106,19 @@ public class MultiSQLServer implements ConnectionEstablisher {
                 bookmark.setPassword(password);
             }
         }
-               Connection con;
+        
         if (password != null) {
-            con = connect(bookmark, password);
+            Connection connection = connect(bookmark, password);
+            if (connection != null) {
+                       // Set the autoCommit state of the bookmark to the default on new connections
+                               bookmark.setAutoCommit(bookmark.getDefaultAutoCommit());
+                               // Set the autoCommit state of the JDBC connection to the bookmark autoCommit statec
+                       setAutoCommit(connection, bookmark.isAutoCommit());
+            }
+               return connection;
         } else {
             return null;
         }
-        // Set the autoCommit state of the bookmark to the default on new connections
-               bookmark.setAutoCommit(bookmark.getDefaultAutoCommit());
-               // Set the autoCommit state of the JDBC connection to the bookmark autoCommit statec
-               setAutoCommit(con, bookmark.isAutoCommit());
-               return con;
         
     }
     private Connection connect(Bookmark bookmark, String password)