package operationMysql import config.conf.{sc, spark_session} import org.apache.spark.sql.DataFrame object readingMysqlOperation { def main(args: Array[String]): Unit = { val df: DataFrame = spark_session.read .format("jdbc") .option("url", "jdbc:mysql://localhost:3306/junsheng?useUnicode=true&characterEncoding=utf-8") .option("dbtable", "订单") .option("user", "root") .option("password", "123456") .load() df.show() } }
原文地址:https://www.cnblogs.com/wuzaipei/p/12623880.html
时间: 2024-10-16 16:24:34