String url = "jdbc:databricks://<cluster-url>"; Properties connectionProperties = new Properties(); connectionProperties.put("user", "<access-token>"); connectionProperties.put("password", ""); connectionProperties.put("authentication", "Token"); Connection conn = DriverManager.getConnection(url, connectionProperties); Statement stmt = conn.createStatement(); String sql = "SELECT * FROM table"; ResultSet rs = stmt.executeQuery(sql); while (rs.next()) { } PreparedStatement pstmt = conn.prepareStatement("INSERT INTO table VALUES (?, ?)"); pstmt.setString(1, "value1"); pstmt.setInt(2, 123); pstmt.executeUpdate();


上一篇:
下一篇:
切换中文