cancel
Showing results forย 
Search instead forย 
Did you mean:ย 
Get Started Discussions
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
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! ๐Ÿš€

 
Welcome to Databricks Community: Lets learn, network and celebrate together

Join our fast-growing data practitioner and expert community of 80K+ members, ready to discover, help and collaborate together while making meaningful connections. 

Click here to register and join today! 

Engage in exciting technical discussions, join a group with your peers and meet our Featured Members.