import com.databricks.client.jdbc.DataSource;
import java.sql.*;
public class testDatabricks {
public static void main(String[] args) throws SQLException {
String dbUrl = "jdbc:databricks://<hostname>:443;HttpPath=<HttpPath>;";
// Copied the hostname and httppath from configuration of instance
DataSource d = new DataSource();
d.setURL(dbUrl);
d.setUserID("token");
d.setPassword("<access-token>");
// Copied access token from user settings
Connection conn = d.getConnection();
Statement s = conn.createStatement();
ResultSet r = s.executeQuery("show schemas");
while(r.next()) {
System.out.println(r.getString("databaseName"));
}
System.out.println("Success");
}
}
I am trying to execute this code to test connection to my Databricks instance. But I get
java.sql.SQLNonTransientConnectionException: [Databricks][JDBC](12330) Cannot establish a successful connection with given properties.
error. Am I missing anything in the setup?
Also, why is the driver guide (Installation and Configuration) missing in then docs folder of the driver?