Support Questions
Find answers, ask questions, and share your expertise
Check out our newest addition to the community, the Cloudera Innovation Accelerator group hub.

Jdbc MsSQL connection error in ambari sandbox

New Contributor

Hi, I am new on sqoop and facing a problem since last 2 days.

I am using Ambari-sandbx on VMware. These the version details
HDP 2.6
Sqoop 1.4.6
I am unable to connect MsSql in sqoop .
When i try to list the databases using below command then i got this error.


sqoop list-databases --connect jdbc:sqlserver://VM-TFS/ --username abc --password test123

ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.RuntimeException: Could not load db driver class:

I googled this error and find a solution here,

According to @Artem Ervits copy sqljdbc42.jar file into the usr/hdp/current/sqoop-client/lib folder

As you can see in the left section of the image-1 that i can view hdp folder In CLI but not in WinSCP.
I downloaded sqljdbc42.jar on my window pc and copied it in to /usr/local by using WinSCP.

Then tried to copy this jar file from /usr/local to /usr/hdp/current/sqoop-client/lib as suggested in the above solution by using below command but got another error.


cp /usr/local/sqljdbc42.jar /usr/hdp/current/sqoop-client/lib

cp: cannot stat `/usr/local/sqljdbc42.jar': No such file or directory

Although sqljdbc42.jar is available in usr/local as you can see in image-2 but i don't know why i getting this error.

Kindly help me.




@Mohsin Aqee

Try below steps:

1. Run command dos2unix /usr/local/sqljdbc42.jar

2. Then try to copy, cp /usr/local/sqljdbc42.jar /usr/hdp/current/sqoop-client/lib as root user.