gobblin-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hut...@apache.org
Subject incubator-gobblin git commit: [GOBBLIN-27] updating connection url for sqlserver with database name
Date Wed, 26 Jul 2017 23:05:29 GMT
Repository: incubator-gobblin
Updated Branches:
  refs/heads/master bd991d781 -> 9ff023cd0


[GOBBLIN-27]
updating connection url for sqlserver with database name

(Arjun Bora via Hung Tran)


Project: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/commit/9ff023cd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/tree/9ff023cd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-gobblin/diff/9ff023cd

Branch: refs/heads/master
Commit: 9ff023cd0c7bb654e4e9bf47ef49c233b6b69b93
Parents: bd991d7
Author: Hung Tran <hutran@linkedin.com>
Authored: Wed Jul 26 15:57:20 2017 -0700
Committer: Hung Tran <hutran@apache.org>
Committed: Wed Jul 26 16:05:18 2017 -0700

----------------------------------------------------------------------
 .../src/main/java/gobblin/source/jdbc/SqlServerExtractor.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-gobblin/blob/9ff023cd/gobblin-modules/gobblin-sql/src/main/java/gobblin/source/jdbc/SqlServerExtractor.java
----------------------------------------------------------------------
diff --git a/gobblin-modules/gobblin-sql/src/main/java/gobblin/source/jdbc/SqlServerExtractor.java
b/gobblin-modules/gobblin-sql/src/main/java/gobblin/source/jdbc/SqlServerExtractor.java
index ebe8289..4a731e3 100644
--- a/gobblin-modules/gobblin-sql/src/main/java/gobblin/source/jdbc/SqlServerExtractor.java
+++ b/gobblin-modules/gobblin-sql/src/main/java/gobblin/source/jdbc/SqlServerExtractor.java
@@ -187,7 +187,9 @@ public class SqlServerExtractor extends JdbcExtractor {
   public String getConnectionUrl() {
     String host = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_HOST_NAME);
     String port = this.workUnitState.getProp(ConfigurationKeys.SOURCE_CONN_PORT);
-    String url = "jdbc:sqlserver://" + host.trim() + ":" + port;
+    String database = this.workUnitState.getProp(ConfigurationKeys.SOURCE_QUERYBASED_SCHEMA);
+    String url = "jdbc:sqlserver://" + host.trim() + ":" + port +
+        (StringUtils.isEmpty(database) ? "" : (";databaseName=" + database.trim()));
     return url;
   }
 


Mime
View raw message