![](/img/trans.png)
[英]While running my Spring boot project with Azure SQL server connection and getting error like Unsupported Database: Microsoft SQL Server 12.0
[英]How to establish a Microsoft azure databricks delta tables connection using spring boot just like mysql,sql server
Hi I want to establish a connection with the Microsoft azure databricks delta table inside my spring boot application.I have the cluster url,username and the password(token) of the delta table from which I need to pull the data to my application. 請對此有所了解
您可以使用 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));
i++;
}
rs.close();
stmt.close();
conn.close();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.