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

db2 sqoop default schema issue


I want to use default schema in my sqoop connection. But getting below error message.

sqoop list-tables --driver --connect jdbc:db2://xxx.xx.xx.xx:xxxx/xxxx:currentSchema=xxxx --username xxxx --password xxxx

Invalid database URL syntax: jdbc:db2://xxx.xx.xx.xx:xx/xx:currentSchema=xxx. ERRORCODE=-4461, SQLSTATE=42815 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 ... 13 more Could not retrieve tables list from server ERROR tool.ListTablesTool: manager.listTables() returned null


Below command successfully ran 
sqoop import-all-tables  --driver --num-mappers 1 --connect jdbc:db2://<database_host>:<database_port>/database  --username XXXXX --password XXXXX -- --schema xxx

But dont know why its accessing the different tables from other schemas?