updating connection url for sqlserver with database name
(Arjun Bora via Hung Tran)
@@ -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;
}
