Support Questions
Find answers, ask questions, and share your expertise
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

passing securitymechanism=13 parameter in Sqoop command

passing securitymechanism=13 parameter in Sqoop command

New Contributor


I have DB2 database in which secutiry mechanism was enabled and we are using Server authentication.

I'm using the sqoop to establish the connection using JDBC with below command and getting error. error says Invalid database URL syntax. so i'm not sure how to pass the parameter.

Can someone please suggest how to precisely pass the securityMechanism in the sqoop CLI.

sqoop list-tables --connect jdbc:db2:// --username xxxxxx--password xxxxxxxxxxxx

SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/usr/hdp/!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/usr/hdp/!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory] 18/01/02 21:43:22 INFO sqoop.Sqoop: Running Sqoop version: 18/01/02 21:43:22 WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead. 18/01/02 21:43:22 INFO manager.SqlManager: Using default fetchSize of 1000 18/01/02 21:43:23 ERROR manager.SqlManager: Error reading database metadata: [jcc][10165][10051][4.19.72] Invalid database URL syntax:jdbc:db2:// ERRORCODE=-4461, SQLSTATE=42815 [jcc][10165][10051][4.19.72] Invalid database URL syntax: jdbc:db2:// ERRORCODE=-4461, SQLSTATE=42815 at at at at at at at java.sql.DriverManager.getConnection( at java.sql.DriverManager.getConnection( at org.apache.sqoop.manager.SqlManager.makeConnection( at org.apache.sqoop.manager.GenericJdbcManager.getConnection( at org.apache.sqoop.manager.SqlManager.listTables( at at at at org.apache.sqoop.Sqoop.runSqoop( at org.apache.sqoop.Sqoop.runTool( at org.apache.sqoop.Sqoop.runTool( at org.apache.sqoop.Sqoop.main( Caused by: java.util.NoSuchElementException at java.util.StringTokenizer.nextToken( at java.util.StringTokenizer.nextToken( at ... 14 more Could not retrieve tables list from server


Re: passing securitymechanism=13 parameter in Sqoop command

Rising Star

The connection string looks correct to me. Do you have the license jar in the same directory as the jdbc jar?


Re: passing securitymechanism=13 parameter in Sqoop command

New Contributor

Hi @Benjamin Hopp

Thanks for your response.

yes License Jar is in same dir. Also to let you know for other environment(Stage) where security mechanism is not enabled on DB2 server it is working fine with out passing paramerter. But On Dev DB2 server they have enabled the security mechanism and its not working when i try with securityMechanism=13 option. I'm not sure if i'm passing it correctly and is that is correct way.

Don't have an account?
Coming from Hortonworks? Activate your account here