K
kingofworl
Unregistered / Unconfirmed
GUEST, unregistred user!
要用oracle的外接表功能,所以要把局域网内ftp服务器上的数据文件下载到本地,不过那些文件都很大,我读一个60兆的文件到本地用了近8分钟,远不能满足要求 ,下面是部分代码,注释的部分用了缓冲速度稍快,不过可惜不会加换行,不行,照直接用工具下载速度慢不止十倍,请教大家有没有什么好方法提高速度,或者用哪个现成的包能实现功能
Name = "BUSI1_RENT_FEE_20050706.TXT";
FtpClient fc = new FtpClient("10.90.0.122"
fc.login("bi", "bi"
int ch;
String da;
File fi = new File("c:/monthreport/"
+ Name);
RandomAccessFile getFile = new RandomAccessFile(fi, "rw"
getFile.seek(0);
fc.cd("data/day_data/complete"
TelnetInputStream fget = fc.get("BUSI1_RENT_FEE_20050706.TXT"
DataInputStream puts = new DataInputStream(fget);
byte[] buff = new byte[40960];
int nch;
// while ( (nch = puts.read(buff, 0, buff.length)) != -1) {
// getFile.write(buff, 0, nch);
//
// }
da = "";
while ( ( (da = puts.readLine())) != null) {
getFile.writeBytes(da + "/r"
+ "/n"
}
fget.close();
getFile.close();
fc.closeServer();
Name = "BUSI1_RENT_FEE_20050706.TXT";
FtpClient fc = new FtpClient("10.90.0.122"
fc.login("bi", "bi"
int ch;
String da;
File fi = new File("c:/monthreport/"
+ Name);
RandomAccessFile getFile = new RandomAccessFile(fi, "rw"
getFile.seek(0);
fc.cd("data/day_data/complete"
TelnetInputStream fget = fc.get("BUSI1_RENT_FEE_20050706.TXT"
DataInputStream puts = new DataInputStream(fget);
byte[] buff = new byte[40960];
int nch;
// while ( (nch = puts.read(buff, 0, buff.length)) != -1) {
// getFile.write(buff, 0, nch);
//
// }
da = "";
while ( ( (da = puts.readLine())) != null) {
getFile.writeBytes(da + "/r"
+ "/n"
}
fget.close();
getFile.close();
fc.closeServer();