|
@@ -0,0 +1,21 @@
|
|
|
+package com.winhc.bigdata.spark.config
|
|
|
+
|
|
|
+import com.winhc.bigdata.spark.const.EnvConst
|
|
|
+
|
|
|
+import java.util.Properties
|
|
|
+
|
|
|
+/**
|
|
|
+ * @author: XuJiakai
|
|
|
+ * @date: 2021/5/31 14:37
|
|
|
+ */
|
|
|
+object MysqlConfig {
|
|
|
+ def getMysqlConfig(): (String, Properties) = {
|
|
|
+ val url: String = "jdbc:mysql://" + EnvConst.getEnv.getValue("mysql.prism1.address") + ":3306/prism1?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&serverTimezone=GMT%2B8"
|
|
|
+ val properties: Properties = new Properties()
|
|
|
+ properties.setProperty("dbtable", "prism1")
|
|
|
+ properties.setProperty("user", "wenshu")
|
|
|
+ properties.setProperty("password", "wenshu_168")
|
|
|
+ properties.setProperty("driver", "com.mysql.cj.jdbc.Driver")
|
|
|
+ (url, properties)
|
|
|
+ }
|
|
|
+}
|