嗨,我想在我的spring boot应用程序中与Microsoft azure databricks delta表建立连接。我有delta表的集群网址、用户名和密码(token),我需要从它那里获取数据到我的应用程序。请告诉我这个问题的一些情况
![]() |
光明磊落的金针菇 · SQL 到 Kusto 查询转换 - ...· 8 月前 · |
![]() |
追风的牛肉面 · python pandas ...· 10 月前 · |
![]() |
重感情的蛋挞 · 清华最新开源 | 性能提升58.7%!3D ...· 1 年前 · |
![]() |
完美的蟠桃 · Halcon缺陷检测实例转OpenCV实现( ...· 1 年前 · |
![]() |
帅气的菠菜 · python ...· 1 年前 · |
你可以使用JDBC访问集群和底层表(见 文档 )。 你需要获得相应的驱动程序,并将其添加到你的应用程序中,然后只需使用正常的 JDBC API ,像这样。
String jdbcConnectPassthroughCluster = "jdbc:spark://<server-hostname>:443/default;transportMode=http;ssl=1;httpPath=sql/protocolv1/o/0/xxxx-xxxxxx-xxxxxxxx;AuthMech=3;UID=token;PWD="; String PATH = "<personal token>" String JDBC_DRIVER = "com.simba.spark.jdbc.Driver"; String DB_URL = jdbcConnectPassthroughCluster + PAT; Class.forName(JDBC_DRIVER); System.out.println("Getting connection"); Connection conn = DriverManager.getConnection(DB_URL); Statement stmt = conn.createStatement(); System.out.println("Going to execute query"); ResultSet rs = stmt.executeQuery("select * from table"); System.out.println("Query is executed"); int i = 0; while(rs.next()) { System.out.println("Row " + i + "=" + rs.getLong(1));