Home Forums Sqoop Data import from SQL Server

This topic contains 3 replies, has 2 voices, and was last updated by  MEJANE Nicolas 1 month ago.

  • Creator
    Topic
  • #59294

    Sreeni Anantha
    Participant

    Hi I am hadoop beginner and exploring some hadoop options from our existing project. here is my question.
    We have Hortonnetwork version of hadoop on windows.
    Iam trying to use below command to load data from on-premisis sql server to HDFS :

    sqoop list-databases –connect jdbc::sqlserver://<servername>:1433 –username <MyUserName> –password <MyPassword>
    This is just to check my connection before pulling actual tables in HDFS..but the command throws below error :

    “Got error creating database manager: java.io.IOException: No manager for connect string: jdbc::sqlserver:<Servername>”
    few background points:
    - Able to ping the server from hadoop server.
    - Have copied sqljdbc4.jar file to sqoop/lib directory.
    -sql server 2012

    Can anyone share their experiences/solutions if you have any such.

    Thanks
    Sreeni

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.

  • Author
    Replies
  • #59388

    MEJANE Nicolas
    Participant

    Hello,

    Can you remove only sqljdbc.jar file from sqoop lib path ,and you let sqljdbc4.jar file ?
    then can you try these 2 commands and tell me for each one your result ?

    sqoop list-databases –connect ‘jdbc:sqlserver://servername;username=user;password=password’

    sqoop import –connect ‘jdbc:sqlserver://servername;database=database;username=user;password=password’ –table ‘table’ –target-dir ‘/user/dir’

    thanks

    Collapse
    #59360

    Sreeni Anantha
    Participant

    Thanks mejane,

    I still get the jdbc error . the error says “Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.”

    I have downloaded and copied sqljdbc4.jar and sqljdbc.jar files to sqoop lib path.

    below is the command and it result :

    COMMAND :
    C:\Hadoop\sqoop-1.4.3.1.3.0.0-0380\bin>sqoop import –driver com.microsoft.sqlserver.jdbc.SQLServerDriver –connect “jdbc:sqlserver://ch1gfssldev;database=skylabuat;username=XXXXX;password=XXXX” –table sku –target-dir /user/hadoopuser/Sreeni/SKYLABUAT/NEWDATA -m 1 –verbose

    RESULT:
    File “C:\hadoop\\hcatalog-0.11.0.1.3.0.0-0380\bin\hcat.py”, line 134
    print “Would run:”
    ^
    SyntaxError: invalid syntax
    14/08/27 13:47:24 DEBUG tool.BaseSqoopTool: Enabled debug logging.
    14/08/27 13:47:24 DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
    14/08/27 13:47:24 WARN sqoop.ConnFactory: Parameter –driver is set to an explicit driver however appropriate connection manager is not being set (via –connection-manager). Sqoop is going to fall back to org.apache.sqoop.manager.
    GenericJdbcManager. Please specify explicitly which connection manager should be used next time.
    14/08/27 13:47:24 INFO manager.SqlManager: Using default fetchSize of 1000
    14/08/27 13:47:24 INFO tool.CodeGenTool: Beginning code generation
    14/08/27 13:47:25 DEBUG manager.SqlManager: No connection paramenters specified. Using regular API for making connection.
    Aug 27, 2014 1:47:25 PM com.microsoft.sqlserver.jdbc.SQLServerConnection <init>
    SEVERE: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
    14/08/27 13:47:25 ERROR sqoop.Sqoop: Got exception running Sqoop: java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provi
    des support for JDBC 4.0.
    java.lang.UnsupportedOperationException: Java Runtime Environment (JRE) version 1.6 is not supported by this driver. Use the sqljdbc4.jar class library, which provides support for JDBC 4.0.
    at com.microsoft.sqlserver.jdbc.SQLServerConnection.<init>(SQLServerConnection.java:238)
    at com.microsoft.sqlserver.jdbc.SQLServerDriver.connect(SQLServerDriver.java:841)

    Collapse
    #59312

    MEJANE Nicolas
    Participant

    Hello,

    Can you try with that syntax :
    sqoop list-databases –connect ‘jdbc:sqlserver://<servername>:1433;username=<username>;password=<password>’

    Hope it work.

    Collapse
Viewing 3 replies - 1 through 3 (of 3 total)