Oo ' Smiling on Java ' oO
從夢里回來,依然記得夢里有你...
BlogJava
::
首頁
::
新隨筆
::
聯系
::
聚合
::
管理
::
8 隨筆 :: 0 文章 :: 10 評論 :: 0 Trackbacks
<
2007年12月
>
日
一
二
三
四
五
六
25
26
27
28
29
30
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
常用鏈接
我的隨筆
我的評論
我的參與
最新評論
留言簿
(1)
給我留言
查看公開留言
查看私人留言
隨筆分類
ioOpr(2)
(rss)
JDBC(1)
(rss)
NHibernate
(rss)
Oracle
(rss)
Struts&Spring&Hibernate(1)
(rss)
生活的瞬間(3)
(rss)
隨筆檔案
2008年9月 (1)
2007年12月 (2)
2006年11月 (5)
收藏夾
我的收藏(4)
(rss)
Bloggers'
Beansoft
BlueDavy
Vip01
曹曉鋼
馬嘉楠
Learning...
Java愛好者
J道.JDon
Programme
Spring和Struts整合
theserverside
當前的網站設計風格
報表制作
Search Engine
My Own Search Engine
搜索
積分與排名
積分 - 12706
排名 - 2172
最新隨筆
1.?Lucene/Heritrix/Nutch Site
2.?下載FTP服務器文件到本地
3.?poi讀excel
4.?一生的35個好習慣(轉)
5.?Spring網站學習資源,很不錯的
6.?獲得ResultSet返回記錄數
7.?代碼規范了
8.?終于安家落戶了
最新評論
1.?re: poi讀excel
評論內容較長,點擊標題查看
--Mary james
2.?re: 獲得ResultSet返回記錄數
int totalRows = rs.getLong("total");
類型就不對,你試過嗎?不懂不要瞎說
--douboer
3.?re: 獲得ResultSet返回記錄數
評論內容較長,點擊標題查看
--furong
4.?re: 獲得ResultSet返回記錄數
好象不能顯示,,你自己試試看,,
--wyp
5.?re: 獲得ResultSet返回記錄數
rs.getLong("total"); 可以嗎?
--jasonu
閱讀排行榜
1.?獲得ResultSet返回記錄數(7931)
2.?poi讀excel(2230)
3.?下載FTP服務器文件到本地(561)
4.?Spring網站學習資源,很不錯的 (521)
5.?Lucene/Heritrix/Nutch Site(327)
評論排行榜
1.?獲得ResultSet返回記錄數(9)
2.?poi讀excel(1)
3.?一生的35個好習慣(轉)(0)
4.?Spring網站學習資源,很不錯的 (0)
5.?Lucene/Heritrix/Nutch Site(0)
下載FTP服務器文件到本地
????
public
?
static
?
void
?main(Sting args[])?
????
{
????????String?createTime?
=
?createTime();
????????String?uid?
=
?
"
XXX
"
;
????????String?pwd?
=
?
"
xxx
"
;
????????String?ftpAddressIp?
=
?
"
**.**.**.***
"
;
????????
int
?port?
=
?
21
;
????????String?local?
=
?
"
d://
"
+
?createTime?
+
"
.xls
"
;
????????String?remote?
=
?
"
remoteFile.xls
"
;
????????
try
????????
{
????????????FTPClient?ftp?
=
?
new
?FTPClient();
????????????ftp.setControlEncoding(
"
GBK
"
);
//
設置編碼方式,解決中文亂碼
????????????ftp.connect(ftpAddressIp,port);
//
連接
????????????ftp.login(uid,?pwd);
//
登陸
????????????ftp.changeWorkingDirectory(
"
list
"
);
//
轉到目錄
????????????
//
輸出文件
????????????File?file?
=
?
new
?File(local);
????????????FileOutputStream?fos?
=
?
new
?FileOutputStream(file);
????????????
//
將remote文件輸出到本地
????????????ftp.retrieveFile(remote?,?fos);
????????????
//
關閉
????????????fos.close();
????????????ftp.logout();
????????????ftp.disconnect();
????????}
????????
catch
?(Exception?e)
????????
{
????????????e.printStackTrace();????????????
????????}
????}
????
????
public
?
static
?String?createTime()
????
{
????????Date?date?
=
?
new
?Date();
????????SimpleDateFormat?form?
=
?
new
?SimpleDateFormat(
"
yyyyMMddmmss
"
);
????????String?createTime?
=
?form.format(date);
????????
return
?createTime;????????
????}
posted on 2007-12-14 00:44
Jwin
閱讀(561)
評論(0)
編輯
收藏
所屬分類:
ioOpr
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
下載FTP服務器文件到本地
poi讀excel
Powered by:
BlogJava
Copyright © Jwin
主站蜘蛛池模板:
高密市
|
德江县
|
竹溪县
|
正安县
|
双城市
|
浪卡子县
|
辉县市
|
正镶白旗
|
米林县
|
泸西县
|
黎城县
|
磐安县
|
南平市
|
栾川县
|
新兴县
|
泸西县
|
谷城县
|
甘肃省
|
宜宾县
|
灵川县
|
桦甸市
|
多伦县
|
兴海县
|
洛扎县
|
西平县
|
苏尼特右旗
|
呈贡县
|
沈阳市
|
眉山市
|
涞源县
|
平原县
|
疏附县
|
佛山市
|
清徐县
|
清丰县
|
昭觉县
|
高台县
|
昌平区
|
徐水县
|
镶黄旗
|
台南县
|