FTP connection fails if passing username and password in properties object |
Suraj Kudale |
2019-10-12 07:04:58 |
I am facing issue while performing FTP connection with following code :
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", "ftpdemo1");
prperties.put("password", "ftp12345");
String sql = "select * from Test";
Whereas If pass this username and password in URL it works perfectly fine.
I have tried above programm with following jars
Text_JDBC40
Text_JDBC42
But nothing works
Exception :
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.(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.(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.hS(Unknown Source)
at com.hxtt.concurrent.i.hU(Unknown Source)
at com.hxtt.sql.b7.a(Unknown Source)
at com.hxtt.sql.text.f.(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)
Could you please help ?
|
Re:FTP connection fails if passing username and password in properties object |
HXTT Support |
2019-10-12 17:07:08 |
I have replied "Maybe you haven't used the latest package."
According to your report, I have again tested JDBC4.0 package(Text_JDBC40.jar 1,663,901 bytes) and JDBC4.2 package(Text_JDBC42.jar 1,679,622 bytes).
No issue for your HXTTConnectionTest sample.
|
Re:FTP connection fails if passing username and password in properties object |
HXTT Support |
2019-10-12 17:08:08 |
BTW, remember
Connection con = DriverManager.getConnection( url,prperties );
or
Connection con = DriverManager.getConnection(url,"ftpdemo1","ftp12345");
|
Re:Re:Re:FTP connection fails if passing username and password in properties object |
Suraj Kudale |
2019-10-12 21:52:48 |
I have tries with latest package one by one but got same exception.
Also tried with Connection con = DriverManager.getConnection(url,"ftpdemo1","ftp12345"); this approach but same exception.
|
Re:Re:Re:Re:FTP connection fails if passing username and password in properties object |
HXTT Support |
2019-10-13 02:31:25 |
Try to isolate your issue, for instance,
d:\jdk1.8.0\jre\bin\java -classpath Text_JDBC40.jar;. test.jdbc.text.HXTTConnectionTest
|
Re:Re:Re:Re:Re:FTP connection fails if passing username and password in properties object |
Suraj Kudale |
2019-10-13 05:10:36 |
Hi I think driver is not supported with username and password approach in properties file.
Could you please look into this issue ? as everything works fine if we provide same things in URL
That means deferentially something is wrong with this getConnection(url,"ftpdemo1","ftp12345"); function.
|
Re:Re:Re:Re:Re:Re:FTP connection fails if passing username and password in properties object |
HXTT Support |
2019-10-13 05:32:21 |
Both of them can work:
Class.forName("com.hxtt.sql.text.TextDriver").newInstance();
String url = "jdbc:csv:/ftp://www.hxtt.net/testdemo/sample?_CSV_Separator=,";
//Connection getConnection(String url, String user, String password);
Properties prperties=new Properties();
prperties.put("user","ftpdemo1");
prperties.put("password","ftp12345");
String sql = "select * from Test";
Connection con = DriverManager.getConnection( url,prperties );
//Connection con = DriverManager.getConnection(url,"ftpdemo1","ftp12345");
You should check the date of your Text_JDBC40.jar because that feature was added after recevied your email.
|
Re:Re:Re:Re:Re:Re:Re:FTP connection fails if passing username and password in properties object |
Suraj Kudale |
2019-10-13 05:52:55 |
It's working. I was not using latest package. Sorry for all trouble.
Thanks for added support for username and password approach. You guys rocks.
Regards,
Suraj
|