Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

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

avatar
New Contributor

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
New Contributor

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
New Contributor

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