ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject incubator-ignite git commit: # IGNITE-32: WIP on parse db metadata.
Date Tue, 27 Jan 2015 11:12:10 GMT
Repository: incubator-ignite
Updated Branches:
  refs/heads/ignite-32 8d58c9b05 -> 6616ad450


# IGNITE-32: WIP on parse db metadata.


Project: http://git-wip-us.apache.org/repos/asf/incubator-ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-ignite/commit/6616ad45
Tree: http://git-wip-us.apache.org/repos/asf/incubator-ignite/tree/6616ad45
Diff: http://git-wip-us.apache.org/repos/asf/incubator-ignite/diff/6616ad45

Branch: refs/heads/ignite-32
Commit: 6616ad4502661f6fe3da30a1b0fc40c54be2eccb
Parents: 8d58c9b
Author: AKuznetsov <akuznetsov@gridgain.com>
Authored: Tue Jan 27 18:12:09 2015 +0700
Committer: AKuznetsov <akuznetsov@gridgain.com>
Committed: Tue Jan 27 18:12:09 2015 +0700

----------------------------------------------------------------------
 .../apache/ignite/schema/ui/SchemaLoadApp.java  | 21 ++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ignite/blob/6616ad45/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
----------------------------------------------------------------------
diff --git a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
index 2b18cd1..b2bee1c 100644
--- a/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
+++ b/modules/schema-load/src/main/java/org/apache/ignite/schema/ui/SchemaLoadApp.java
@@ -79,6 +79,9 @@ public class SchemaLoadApp extends Application {
     private PasswordField pwdTf;
 
     /** */
+    private ComboBox<String> parseCb;
+
+    /** */
     private GridPaneEx connPnl;
 
     /** */
@@ -192,13 +195,17 @@ public class SchemaLoadApp extends Application {
     private void fill() {
         lockUI(connLayerPnl, connPnl, nextBtn);
 
+        final String jdbcDrvJarPath = jdbcDrvJarTf.getText().trim();
+
+        final boolean tblsOnly = parseCb.getSelectionModel().getSelectedIndex() == 0;
+
         Runnable task = new Task<Void>() {
             /** {@inheritDoc} */
             @Override protected Void call() throws Exception {
                 long started = System.currentTimeMillis();
 
-                try (Connection conn = connect()) {
-                    pojos = DatabaseMetadataParser.parse(conn);
+                try (Connection conn = connect(jdbcDrvJarPath)) {
+                    pojos = DatabaseMetadataParser.parse(conn/*, tblsOnly*/);
                 }
 
                 perceptualDelay(started);
@@ -274,6 +281,7 @@ public class SchemaLoadApp extends Application {
                     Platform.runLater(new Runnable() {
                         @Override public void run() {
                             pojosTbl.getSelectionModel().select(pojo);
+                            pojosTbl.scrollTo(pojosTbl.getSelectionModel().getSelectedIndex());
                         }
                     });
 
@@ -467,18 +475,17 @@ public class SchemaLoadApp extends Application {
     /**
      * Connect to database.
      *
+     * @param jdbcDrvJarPath Path to JDBC driver.
      * @return Connection to database.
      * @throws SQLException if connection failed.
      */
-    private Connection connect() throws SQLException {
+    private Connection connect(String jdbcDrvJarPath) throws SQLException {
         String drvCls = jdbcDrvClsTf.getText();
 
         Driver drv = drivers.get(drvCls);
 
         if (drv == null) {
-            String path = jdbcDrvJarTf.getText().trim();
-
-            if (path.isEmpty())
+            if (jdbcDrvJarPath.isEmpty())
                 throw new IllegalStateException("Driver jar file name is not specified");
 
             File drvJar = new File(jdbcDrvJarTf.getText());
@@ -556,6 +563,8 @@ public class SchemaLoadApp extends Application {
 
         pwdTf = connPnl.addLabeled("Password:", passwordField("User password"), 2);
 
+        parseCb = connPnl.addLabeled("Parse:", comboBox("Type of tables to parse", "Tables
only", "Tables and Views"), 2);
+
         connLayerPnl = stackPane(connPnl);
 
         return connLayerPnl;


Mime
View raw message