简体   繁体   English

如何使用 spring 启动建立 Microsoft azure databricks 增量表连接,就像 mysql,ZAC5C74B61AFFB4BAC28 服务器一样

[英]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. 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. Kindly shed some light on this请对此有所了解

You can access cluster & underlying tables using the JDBC (see documentation ).您可以使用 JDBC 访问集群和基础表(请参阅文档)。 You need to get the corresponding driver, and add it to your application, and then just use normal JDBC API , like this:您需要获取相应的驱动程序,并将其添加到您的应用程序中,然后使用普通的 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.

相关问题 在使用 Azure SQL 服务器连接运行我的 Spring 引导项目时出现错误,例如不受支持的数据库:Microsoft SQL Server 12.0 - While running my Spring boot project with Azure SQL server connection and getting error like Unsupported Database: Microsoft SQL Server 12.0 带有 Mysql 数据库和 Microsoft Azure 的 Spring Boot 应用程序 - Spring Boot App with Mysql database and Microsoft Azure 在 Azure Synapse 专用/无服务器 SQL 池中使用增量表 - Using Delta Tables in Azure Synapse Dedicated/Serverless SQL Pools 我们可以将本地 SQL 服务器数据库中的表连接到 Azure Delta 湖中的 Delta 表中的表吗? 我有什么选择 - Can we join tables in on-premise SQL Server database to tables in Delta tables in Azure Delta lake? what are my options 如何从本地到SQL Azure数据库建立安全连接字符串 - How to establish secure connection string from on premises to SQL Azure Database 使用 Spring Boot 时 Azure 中的连接字符串 - Connection String in Azure while using Spring Boot Spring Boot 无法连接到 Azure SQL Server - Spring Boot Could not connect to Azure SQL Server 连接Azure Sql Server和Spring Boot的异常 - Exception connecting Azure Sql Server and Spring Boot 无法在Windows 10上使用Pyodbc建立与sql-server的连接 - Cannot establish connection to sql-server using pyodbc on Windows 10 Microsoft Azure上的Spring Boot应用程序 - Spring Boot App on Microsoft Azure
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM