- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 09:05 AM
I'm trying to use a very basic java program to connect to Databricks using spark jdbc driver (SparkJDBC42.jar), but I get the error (mentioned above):
[Simba][SparkJDBCDriver](500177) Error getting http path from connection string
Here is my code snippet:
import java.sql.*;
class JDBCTest
{
public static void main(String args[]) throws SQLException
{
Connection con = null;
try
{
Class.forName("com.simba.spark.jdbc.Driver");
String dbURL = "jdbc:spark://dbc-29cb99e0-2b6f.cloud.databricks.com:443/default;transportMode=http;ssl=1;AuthMech=3";
System.out.println("jdbcurl=" + dbURL);
String strUserID = "User1@mail.com";
String strPassword = "Password#1";
con=DriverManager.getConnection(dbURL,strUserID,strPassword);
System.out.println("Connected to the database.");
Statement stmt=con.createStatement();
System.out.println("Executing query");
ResultSet rs=stmt.executeQuery("SELECT * FROM default.table1");
while(rs.next())
System.out.println("1");
con.close();
}catch(Exception e){ System.out.println(e);}
finally
{
con.close();
}
}
}
Running command: java -cp SparkJDBC42.jar:. JDBCTest "test"
I'm using the jdbc url provided for my connection endpoint.
This same code works for other databases.
It seems to be with the Spark driver that doesn't allow me to even reach the point at which I attempt to connect.
Your help is appreciated. Thank you
- Labels:
-
Connection String
-
Simba
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 03:30 PM
I found my issue. I was missing the httpPath in the URL. That fixed it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-07-2022 03:30 PM
I found my issue. I was missing the httpPath in the URL. That fixed it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2025 06:35 AM
I am getting the same error, can you explain what you mean httpPath was missing?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 09:55 AM
Hello @Claude Repono
Thank you for posting your question in the community. It seems you were able to find the solution by yourself. That's awesome. We are going to go ahead and mark your answer as the best solution.

