Reply
New Contributor
Posts: 2
Registered: ‎09-20-2014
Accepted Solution

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

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

Cloudera Employee abe
Cloudera Employee
Posts: 109
Registered: ‎08-08-2013

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

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.
New Contributor
Posts: 2
Registered: ‎09-20-2014

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

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

 

Announcements
New solutions