1:为日志查询添加clickhouse数据源
2:为nis.properties中添加 存储分组复用域配置的redisdb属性
This commit is contained in:
@@ -33,8 +33,8 @@ import com.nis.web.service.SpringContextHolder;
|
||||
* @date 2018年8月20日
|
||||
*
|
||||
*/
|
||||
public class HiveJDBCByDruid {
|
||||
private final static Logger logger = LoggerFactory.getLogger(HiveJDBCByDruid.class);
|
||||
public class LogJDBCByDruid {
|
||||
private final static Logger logger = LoggerFactory.getLogger(LogJDBCByDruid.class);
|
||||
static DruidDataSource datasource = null;
|
||||
Connection conn = null;
|
||||
ResultSet rs = null;
|
||||
@@ -43,6 +43,7 @@ public class HiveJDBCByDruid {
|
||||
public static Connection getConnection() throws SQLException {
|
||||
if (datasource == null) {
|
||||
datasource = (DruidDataSource) SpringContextHolder.getBean("HiveDataSourceByDruid");
|
||||
// datasource = (DruidDataSource) SpringContextHolder.getBean("ClickHouseDataSourceByDruid");
|
||||
}
|
||||
return datasource.getConnection();
|
||||
}
|
||||
@@ -91,6 +91,14 @@ public class PropertyPlaceholderConfigurerCrypt extends PropertyPlaceholderConfi
|
||||
new String(AESUtil.decrypt(Base64.decodeBase64(clusterPassword), clusterScretKey)));
|
||||
}
|
||||
|
||||
//clickhouse
|
||||
String clickHousePassword = props.getProperty("jdbc.clickhouse.password");
|
||||
String clickHouseScretKey = props.getProperty("jdbc.clickhouse.key");
|
||||
if (null != clickHousePassword) {
|
||||
props.setProperty("jdbc.clickhouse.password",
|
||||
new String(AESUtil.decrypt(Base64.decodeBase64(clickHousePassword), clickHouseScretKey)));
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user