cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

I need to use the ojdbc jar file which is in workspace>Driver inside my notebook

Leo_dass
New Contributor II

Hi, Currently I'm working on a project . Where I need to connect with Oracle database from databricks notebook. To do this I need Ojdbc jar file. But my client has installed that jar file in workspace>Driver and not in the cluster library. So to use this I need this jar file in my notebook . How can I install this jar file which is there in the workspace inside my notebook

 

2 REPLIES 2

saurabh18cs
Contributor II

do this in your notebook:


# Path to the ojdbc JAR file in the workspace
jar_path = "/Workspace/Driver/ojdbc8.jar"

# Install the JAR file from the workspace into the cluster
dbutils.library.install(jar_path)

# Restart the cluster to ensure the JAR file is loaded
dbutils.library.restartPython()

Hi thanks for your time . This is the error I'm geting now

'LibraryHandler' object has no attribute 'install'

Follwed the below steps

# Path to the ojdbc JAR file in the workspace
jar_path = "/Workspace/Drivers/ojdbc8 1.jar"

# Set the JAR file in the Spark configuration
spark.conf.set("spark.jars", jar_path)

# Restart the cluster to ensure the JAR file is loaded
dbutils.library.restartPython()
 
for the above also I got this error: AnalysisException: [CANNOT_MODIFY_CONFIG] Cannot modify the value of the Spark config: "spark.jars". 

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group