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
搜索
積分與排名
積分 - 12724
排名 - 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返回記錄數(7934)
2.?poi讀excel(2232)
3.?下載FTP服務器文件到本地(563)
4.?Spring網站學習資源,很不錯的 (523)
5.?Lucene/Heritrix/Nutch Site(329)
評論排行榜
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
閱讀(563)
評論(0)
編輯
收藏
所屬分類:
ioOpr
新用戶注冊
刷新評論列表
只有注冊用戶
登錄
后才能發表評論。
網站導航:
博客園
IT新聞
Chat2DB
C++博客
博問
管理
相關文章:
下載FTP服務器文件到本地
poi讀excel
Powered by:
BlogJava
Copyright © Jwin
主站蜘蛛池模板:
德令哈市
|
彩票
|
贵定县
|
西乌
|
紫阳县
|
无极县
|
桓台县
|
饶阳县
|
迁西县
|
宁化县
|
长武县
|
嘉鱼县
|
绿春县
|
乌鲁木齐县
|
南澳县
|
张北县
|
华安县
|
卢氏县
|
团风县
|
唐河县
|
浦江县
|
镇江市
|
二手房
|
手机
|
聂荣县
|
神农架林区
|
徐汇区
|
娱乐
|
瑞丽市
|
福鼎市
|
峨山
|
和平县
|
和静县
|
上饶市
|
宁南县
|
兴化市
|
延津县
|
高雄市
|
滦平县
|
敖汉旗
|
红原县
|