Archives of Support Questions (Read Only)

This is an archived board for historical reference. Information and links may no longer be available or relevant
Announcements
This board is archived and read-only for historical reference. To ask a new question, please post a new topic on the appropriate active board.

java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.OracleDriver

avatar

Hi,

I am testing loading oracle tables into hdfs/hadoop/hive with the following command

 

sqoop import --connect jdbc:oracle:thin:@<host>:<port>/<db>--username <user name> -P --table <TABLE>

 

i have copied ojdbc5.jar and ojdbc6.jar files in /usr/lib/sqoop/lib/ on the node from where I am running SQOOP.

 

I am getting the following error

 

java.lang.RuntimeException: Could not load db driver class: oracle.jdbc.OracleDriver

 

I also tried 

 

export SQOOP_CLASSPATH=/usr/lib/sqoop/lib/*

 

any ideas...?

 

thanks

1 ACCEPTED SOLUTION

avatar

all, 

I found a solution and here it is 

 

If parcels are used then copy oracle jdbc driver to /opt/cloudera/parcels/CDH/lib/sqoop/lib

 

Copying ojdbc5.jar to /opt/cloudera/parcels/CDH/lib/sqoop/lib resolved my issue

 

Thanks,

Prakash

 

View solution in original post

2 REPLIES 2

avatar
Expert Contributor
Hey there,

What java version are you running? ojdbc5.jar should be for JDK 1.5 and ojdbc6.jar should be for JDK 1.6. Choose the jar appropriately.

If the above doesn't work, you should be able to add a "--verbose" flag after "import" in the command you've provided to see the classpaths being used.

avatar

all, 

I found a solution and here it is 

 

If parcels are used then copy oracle jdbc driver to /opt/cloudera/parcels/CDH/lib/sqoop/lib

 

Copying ojdbc5.jar to /opt/cloudera/parcels/CDH/lib/sqoop/lib resolved my issue

 

Thanks,

Prakash