我正在尝试使用 hxtt 驱动程序通过 FTP 访问一个文件,但我能够建立连接。如果我在 URL 中传递用户名和密码是成功的,但是如果我在属性文件中分别传递用户名和密码,我会得到一个异常。请参阅以下详细信息:
我试过的罐子:
- text_JDBC40.jar 最新jar
- text_JDBC41.jar 最新jar
- text_JDBC42.jar 最新jar
工作正常:
Class.forName("com.hxtt.sql.text.TextDriver").newInstance();
String url = "jdbc:csv:/ftp://<username>:<password>@www.hxtt.net/testdemo/sample?_CSV_Separator=,";
String sql = "select * from Test";
Connection con = DriverManager.getConnection(url);
抛出异常:
Class.forName("com.hxtt.sql.text.TextDriver").newInstance();
String url = "jdbc:csv:/ftp://www.hxtt.net/testdemo/sample?_CSV_Separator=,";
Properties prperties = new Properties();
prperties.put("user", "<username>");
prperties.put("password", "<password>");
String sql = "select * from Test";
例外:
java.sql.SQLException: Failed to login ftp server www.hxtt.net:21
at com.caigen.global.ao.a(Unknown Source)
at com.hxtt.concurrent.e.a(Unknown Source)
at com.hxtt.concurrent.e.<init>(Unknown Source)
at com.hxtt.concurrent.ak.aL(Unknown Source)
at com.hxtt.concurrent.ak.if(Unknown Source)
at com.hxtt.concurrent.bm.a(Unknown Source)
at com.hxtt.concurrent.ak.<init>(Unknown Source)
at com.hxtt.concurrent.az.a(Unknown Source)
at com.hxtt.concurrent.a9.a(Unknown Source)
at com.hxtt.concurrent.ak.a(Unknown Source)
at com.hxtt.concurrent.av.iL(Unknown Source)
at com.hxtt.concurrent.i.iN(Unknown Source)
at com.hxtt.sql.b7.a(Unknown Source)
at com.hxtt.sql.text.f.<init>(Unknown Source)
at com.hxtt.sql.text.EmbeddedDriver.connect(Unknown Source)
at com.hxtt.global.g.a(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.test.HXTTConnectionTest4.main(HXTTConnectionTest4.java:35)
java.sql.SQLException: Failed to login ftp server www.hxtt.net:21
at com.caigen.global.ao.a(Unknown Source)
at com.hxtt.concurrent.e.a(Unknown Source)
at com.hxtt.concurrent.e.<init>(Unknown Source)
at com.hxtt.concurrent.ak.aL(Unknown Source)
at com.hxtt.concurrent.ak.if(Unknown Source)
at com.hxtt.concurrent.bm.a(Unknown Source)
at com.hxtt.concurrent.ak.<init>(Unknown Source)
at com.hxtt.concurrent.az.a(Unknown Source)
at com.hxtt.concurrent.a9.a(Unknown Source)
at com.hxtt.concurrent.ak.a(Unknown Source)
at com.hxtt.concurrent.av.iL(Unknown Source)
at com.hxtt.concurrent.i.iN(Unknown Source)
at com.hxtt.sql.b7.a(Unknown Source)
at com.hxtt.sql.text.f.<init>(Unknown Source)
at com.hxtt.sql.text.EmbeddedDriver.connect(Unknown Source)
at com.hxtt.global.g.a(Unknown Source)
at com.hxtt.sql.HxttDriver.if(Unknown Source)
at com.hxtt.sql.HxttDriver.connect(Unknown Source)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.test.HXTTConnectionTest4.main(HXTTConnectionTest4.java:35)