cancel
Showing results for 
Search instead for 
Did you mean: 
Get Started Discussions
Start your journey with Databricks by joining discussions on getting started guides, tutorials, and introductory topics. Connect with beginners and experts alike to kickstart your Databricks experience.
cancel
Showing results for 
Search instead for 
Did you mean: 

Using com.databricks:databricks-jdbc:2.6.36 inside oracle stored proc

Ujeen
New Contributor

Hi dear Databricks community,

We tried to use databricks-jdbc inside oracle store procedure to load something from hive. However Oracle marked databricks-jdbc invalid because some classes (for example  com.databricks.client.jdbc42.internal.io.netty.util.internal.logging.Log4JLoggerFactory) are importing non-existent package: 

import com.databricks.client.jdbc42.internal.apache.log4j.Logger;

if this was done intentionally inside databricks jdbc lib is it possible to make oracle load that jar still anyhow ?

Thank you 

Sincerely Yours, Eugene

1 REPLY 1

Kaniz_Fatma
Community Manager
Community Manager

Hi @Ujeen , When integrating Databricks JDBC with an Oracle-stored procedure to load data from Hive, encountering issues related to missing classes can be frustrating.

Let’s explore some potential solutions:

  1. Check Dependencies:

    • Ensure that all necessary dependencies are correctly configured. Verify that the Databricks JDBC driver and any other required libraries are accessible to Oracle.
    • Confirm that the classpath includes the relevant JAR files.
  2. Oracle Invalid Objects:

    • When Oracle marks a package or class as invalid, it means that the referenced objects are not available or are in an inconsistent state.
    • To address this, you can try recompiling the invalid objects using the following SQL command:
      ALTER PACKAGE <package_name> COMPILE;
      
    • Replace <package_name> with the actual name of the package containing the invalid class.
  3. Custom Class Loading:

    • Oracle allows custom class loading using the loadjava utility.
    • You can load the required JAR file into the Oracle database using the following command:
      loadjava -user <username>/<password>@<database> -resolve -verbose <path_to_jar_file>
      
      • Replace <username>, <password>, <database>, and <path_to_jar_file> with appropriate values.
    • After loading the JAR, you can create a Java source in Oracle that references the classes from the JAR.
  4. Grant Permissions:

    • Ensure that the Oracle user executing the stored procedure has the necessary permissions to access the JAR and its classes.
    • Grant the required privileges using:
      GRANT EXECUTE ON <package_name> TO <user>;
      
  5. Debugging:

    • Check the Oracle logs for detailed error messages related to the missing classes.
    • Investigate whether there are any classpath issues or conflicts.

For more specific guidance, consult the relevant documentation for both Oracle and Databricks12.

Hopefully, you’ll soon have your Databricks JDBC integration working seamlessly! 🚀

 
Join 100K+ Data Experts: Register Now & Grow with Us!

Excited to expand your horizons with us? Click here to Register and begin your journey to success!

Already a member? Login and join your local regional user group! If there isn’t one near you, fill out this form and we’ll create one for you to join!