Forum Discussion
Fabric notebook - Oracle connection error: java.lang.ClassNotFoundException
Ok, I'll wait for your next reply.
Hello Rodrivieiras ,
Apologies for the delay in reply from our side.
Please try to load the jar via the following magic:
# Load jar directly to the Scala interpreter
%load_new_custom_jar {mssparkutils.nbResPath}/builtin/Animation1.jar
Starting a new SparkSession doesn't work here. You can also drag and drop a jar file from notebook filesystem. Here's the doc: How to use notebooks - Microsoft Fabric | Microsoft Learn
Hope this is helpful. Please let me know incase of further queries.
- Rodrivieiras2 years agoHelper I
Thanks for the suggestions.
I'll try them out and let you know if they work.
- Rodrivieiras2 years agoHelper I
I tested the code using the suggested syntax:
%load_new_custom_jar {mssparkutils.nbResPath}/builtin/ojdbc11.jar
However the error persists.
Py4JJavaError: An error occurred while calling o4395.load.
: java.lang.ClassNotFoundException: oracle.jdbc.driver.OracleDriver
I suppose this could be related to JDBC, JDK and Oracle interop versions.
I'm trying to access an Oracle 11.2.0.4 database, but the JDK defined in Fabric is JDK 11:
openjdk version "11.0.22" 2024-01-16 LTS
OpenJDK Runtime Environment Microsoft-8909545 (build 11.0.22+7-LTS)
OpenJDK 64-Bit Server VM Microsoft-8909545 (build 11.0.22+7-LTS, mixed mode, sharing)
It seems that to access Oracle DB 11.2, the correct JDK to use is not JDK11, but JDK 6, 7 or 8, according to the Oracle website:
Is there a way to downgrade Fabric JDK11 to JDK8, for example?
Thanks!
- Anonymous2 years agoNot applicable
Hello Rodrivieiras ,
At this time, we are reaching out to the internal team to get some help on this .
We will update you once we hear back from them.