Fix the bug where MySQL credential isn't properly passed to DatabaseWriter. (#585)

This commit is contained in:
Mars Lan 2017-06-28 16:23:18 -07:00
parent 8058734917
commit a950cdbc1a
2 changed files with 3 additions and 3 deletions

View File

@ -44,9 +44,9 @@ public class DatabaseWriter extends Writer {
this.tableName = tableName;
}
public DatabaseWriter(String connectionUrl, String tableName)
public DatabaseWriter(String connectionUrl, String username, String password, String tableName)
throws SQLException {
DriverManagerDataSource dataSource = new DriverManagerDataSource(connectionUrl);
DriverManagerDataSource dataSource = new DriverManagerDataSource(connectionUrl, username, password);
this.jdbcTemplate = new JdbcTemplate(dataSource);
this.tableName = tableName;
}

View File

@ -95,7 +95,7 @@ public class AzLineageExtractorMaster {
String wherehowsUserName = prop.getProperty(Constant.WH_DB_USERNAME_KEY);
String wherehowsPassWord = prop.getProperty(Constant.WH_DB_PASSWORD_KEY);
Connection conn = DriverManager.getConnection(wherehowsUrl, wherehowsUserName, wherehowsPassWord);
DatabaseWriter databaseWriter = new DatabaseWriter(conn.getMetaData().getURL(), "stg_job_execution_data_lineage");
DatabaseWriter databaseWriter = new DatabaseWriter(wherehowsUrl, wherehowsUserName, wherehowsPassWord, "stg_job_execution_data_lineage");
AzLogParser.initialize(conn);
PathAnalyzer.initialize(conn);