Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error while connecting to Databases in DataBrick Community Edition on Cloud . #51

Open
joshipm opened this issue Nov 24, 2019 · 4 comments

Comments

@joshipm
Copy link

joshipm commented Nov 24, 2019

HI,
I have downloaded repository and I was able to execute and practice all example . But when I am trying to execute examples related to SQL data source from Chapter 9 Data Source I am getting following error. I don't have any clue on what to do so please guide me. Thanks in advance.
Error"Java.sql.SQLException: path to '/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db': '/databricks-datasets' does not exist"

Path do exists when I run %fs ls and I get following

dbfs:/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db

Following are parameters

driver = "org.sqlite.JDBC" path = "/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db" url = "jdbc:sqlite:" + path tablename = "flight_info"

@bllchmbrs
Copy link
Contributor

bllchmbrs commented Nov 25, 2019

try with /dbfs/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db"

@joshipm
Copy link
Author

joshipm commented Nov 25, 2019

Thanks it worked

@joshipm joshipm closed this as completed Nov 25, 2019
@joshipm joshipm reopened this Aug 19, 2020
@bj9306
Copy link

bj9306 commented Nov 30, 2020

how did you fix this? i am getting same error even after making above suggestion.

driver = "org.sqlite.JDBC"
path = "/dbfs/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db"
url = "jdbc:sqlite:" + path
tablename = "flight_info"

dbDataFrame = spark.read.format("jdbc").option("url", url).option("dbtable", tablename).option("driver", driver).load()

Py4JJavaError: An error occurred while calling o608.load.
: java.sql.SQLException: path to '/dbfs/databricks-datasets/definitive-guide/data/flight-data/jdbc/my-sqlite.db': '/dbfs/databricks-datasets' does not exist
at org.sqlite.core.CoreConnection.open(CoreConnection.java:192)
at org.sqlite.core.CoreConnection.(CoreConnection.java:76)
at org.sqlite.jdbc3.JDBC3Connection.(JDBC3Connection.java:24)
at org.sqlite.jdbc4.JDBC4Connection.(JDBC4Connection.java:23)
at org.sqlite.SQLiteConnection.(SQLiteConnection.java:45)
at org.sqlite.JDBC.createConnection(JDBC.java:114)
at org.sqlite.JDBC.connect(JDBC.java:88)

@brianclements03
Copy link

Also getting same error after trying the correction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants