如果我为 oracle Thin 提供 (--connect/--user/--password),我可以在不提供 --driver 参数的情况下运行 Sqoop。
但是我需要使用我的项目中使用的自定义 JDBC 驱动程序(它正确实现 java.sql.Driver 接口)而不是 oracle.jdbc.OracleDriver 来运行它。
我无法通过简单地用--driver
参数证明它来让它工作。这个建议根本没有帮助。
如何将 Sqoop 与自定义数据库访问驱动程序一起使用? 如何克服我得到的错误?
如果它与连接管理器有关,有人可以告诉我应该指定哪个连接管理器吗?
谢谢!
这是我真正想做的事情:
./sqoop.sh import \
--fs $HDFS --jt $JT \
--connect <cutom-connection-string> --username username --password password \
--table SYS.ALL_TABLES --split-by TABLE_NAME --target-dir /temp/try/110 --verbose \
--driver xx.xx.xx.MyDriver
我收到一个错误:
错误 manager.SqlManager:错误执行语句:java.sql.SQLException:ORA-00933:SQL 命令未正确结束
更多错误信息:
DEBUG tool.BaseSqoopTool: Enabled debug logging.
WARN tool.BaseSqoopTool: Setting your password on the command-line is insecure. Consider using -P instead.
DEBUG sqoop.ConnFactory: Loaded manager factory: com.cloudera.sqoop.manager.DefaultManagerFactory
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.
INFO manager.SqlManager: Using default fetchSize of 1000
INFO tool.CodeGenTool: Beginning code generation
INFO xx.xx.xx.MyDriver: xx.xx.xx.MyDriver registered successfully.
DEBUG manager.SqlManager: No connection paramenters specified. Using regular API for making connection.
INFO xx.xx.xx.MyDriver: Returning database connection
DEBUG manager.SqlManager: Using fetchSize for next query: 1000
INFO manager.SqlManager: Executing SQL statement: SELECT t.* FROM SYS.ALL_TABLES AS t WHERE 1=0
ERROR manager.SqlManager: Error executing statement: java.sql.SQLException: ORA-00933: SQL command not properly ended
java.sql.SQLException: ORA-00933: SQL command not properly ended