Support Questions
Find answers, ask questions, and share your expertise

Jdbc MsSQL connection error in ambari sandbox

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.

command:

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

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

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.


command:

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

error:
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.

64491-image-1.jpg

64492-image-2.jpg


1 REPLY 1
Highlighted

Re: Jdbc MsSQL connection error in ambari sandbox

@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.