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
搜索
積分與排名
積分 - 12657
排名 - 2171
最新隨筆
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返回記錄數(7927)
2.?poi讀excel(2225)
3.?下載FTP服務器文件到本地(557)
4.?Spring網站學習資源,很不錯的 (517)
5.?Lucene/Heritrix/Nutch Site(323)
評論排行榜
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
閱讀(557)
評論(0)
編輯
收藏
所屬分類:
ioOpr
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
下載FTP服務器文件到本地
poi讀excel
Powered by:
BlogJava
Copyright © Jwin
主站蜘蛛池模板:
崇仁县
|
永新县
|
建阳市
|
武隆县
|
浮梁县
|
长顺县
|
金沙县
|
迭部县
|
交城县
|
鄂温
|
滁州市
|
扶余县
|
鄄城县
|
杭州市
|
交口县
|
内江市
|
靖西县
|
缙云县
|
镇宁
|
涟源市
|
喀喇沁旗
|
陕西省
|
呼玛县
|
洪雅县
|
金平
|
蒙城县
|
报价
|
咸丰县
|
峨边
|
六安市
|
绵竹市
|
永登县
|
夏津县
|
周口市
|
沙坪坝区
|
兰坪
|
苗栗县
|
阿瓦提县
|
高台县
|
和政县
|
东兰县
|