Vincent.Chan‘s Blog

          常用鏈接

          統(tǒng)計(jì)

          積分與排名

          網(wǎng)站

          最新評(píng)論

          2005年12月31日 #

          博客轉(zhuǎn)移

          本博客決定轉(zhuǎn)移,請(qǐng)?jiān)L問新地址 http://vincentchan.cn/
          另外如果有人有blogjava轉(zhuǎn)wordpress的博客搬家工具,可以共享一下~~

          posted @ 2010-04-27 19:15 Vincent.Chen 閱讀(252) | 評(píng)論 (0)編輯 收藏

          eclipse polish debug error

          I have seen something like that if the option "Suspend execution on uncaught exceptions" in windows/preferences/Java/Debug is checked. It must be unchecked to get the debugger to work.

          posted @ 2009-04-30 09:34 Vincent.Chen 閱讀(205) | 評(píng)論 (0)編輯 收藏

          諾基亞軟件

          電源文件
          漢化

          posted @ 2009-04-23 18:55 Vincent.Chen 閱讀(191) | 評(píng)論 (0)編輯 收藏

          Axis客戶端調(diào)service產(chǎn)生java.lang.reflect.InvocationTargetException錯(cuò)誤

          Tomcat+Axis客戶端調(diào)service產(chǎn)生java.lang.reflect.InvocationTargetException錯(cuò)誤

          產(chǎn)生這個(gè)文題的原因是

          1.server端發(fā)布的webservice程序中調(diào)用了某些jar或class,而服務(wù)器上卻沒有,解決方法是把jar或class拷貝到tomcat\common\lib或虛擬目錄的web-inf\lib目錄下
          2.調(diào)用的方法出現(xiàn)了特殊的exception.但是你服務(wù)器上面沒有捕獲到

           我一開始用jbuilder開發(fā)程序的時(shí)候,service端引用了 一些I2的jar,單調(diào)service的程序總是成功,一到Client端調(diào)用service時(shí),service端就報(bào)這個(gè)錯(cuò)誤,于是百度的一把,無意間 看到了CSDN上的一位高手的解釋,于是有點(diǎn)恍然大悟,因?yàn)槲以趈builder中設(shè)置了環(huán)境變量,調(diào)式才沒問題,而部署的服務(wù)器上沒有這些 jar,service執(zhí)行的時(shí)候找不到從而報(bào)錯(cuò),而且在我的虛擬目錄下的lib目錄中又新建了個(gè)文件夾,把jar放在新建的文件夾下,估計(jì)這也是問題之 一,后來我把用到了jar全部考到tomcat\common\lib下,用Client去調(diào)service時(shí)終于不報(bào)錯(cuò)了,看來這文件還不能亂放阿 (jar一定要放在lib目錄下俄,汗那)

          posted @ 2009-03-23 09:09 Vincent.Chen 閱讀(3494) | 評(píng)論 (0)編輯 收藏

          Eclipse + MinGW + Qt開發(fā)環(huán)境設(shè)置

               摘要:   閱讀全文

          posted @ 2009-03-14 13:34 Vincent.Chen 閱讀(408) | 評(píng)論 (0)編輯 收藏

          安妮寶貝經(jīng)典語錄

               摘要:
          ●我喜歡寂寞的人,因?yàn)樗麄兩屏?
          ●傷口是別人給予的恥辱,自己堅(jiān)持的幻覺。
          ●某天如果我覺得不再愛你了,我就不會(huì)再感覺寂寞。
          ●我不相信愛情,但我可以接受它。
          ●當(dāng)一個(gè)女子在看天空的時(shí)候,她并不想尋找什么。她只是寂寞。
            閱讀全文

          posted @ 2008-07-04 23:42 Vincent.Chen 閱讀(425) | 評(píng)論 (0)編輯 收藏

          最近在網(wǎng)上看到一段話

          女孩子二十歲左右是她最美麗的年華
          這時(shí)她心地最善良,有點(diǎn)成熟,又有點(diǎn)孩子氣

          男孩子二十歲左右是他最黯淡的日子,這時(shí)他什么都沒有,不能獨(dú)立卻又不想依賴,掙扎著
          彷徨著,尋找著自己的位置。
          所以,
          如果一個(gè)男孩子在他二十歲左右的時(shí)候遇到一個(gè)年紀(jì)相當(dāng)?shù)呐⒆樱且欢ㄒ湎驗(yàn)?br /> 這個(gè)女孩子用自己最美麗的年華陪他走過了最黯淡的日子!女孩只要陪他走過,女孩子將永
          遠(yuǎn)幸福下去……

          posted @ 2008-07-01 00:34 Vincent.Chen 閱讀(270) | 評(píng)論 (0)編輯 收藏

          轉(zhuǎn):被孤獨(dú)詛咒了的青春

          那天大姨來看我,一起吃頓飯,又把我循循教導(dǎo)一番,給我舉了表姐單位幾位的大齡女青年
          的例子,告誡我一定不要眼光太高,哪里有十全十美的人云云。

          我只能苦笑,哪里有什么高標(biāo)準(zhǔn)......

          以前很奇怪,為什么一說到這個(gè)事情,大家都會(huì)不約而同的認(rèn)定是我眼光高,太挑剔了。后
          來想明白,可能也是大家的仁慈。那么若不是眼光高,那又是為什么呢?他們很奇怪,我也
          很奇怪。

                前言:我知道造成這樣孤獨(dú)的生活是我的錯(cuò),但不知道自己錯(cuò)在哪里,所以只好認(rèn)為
          是被孤獨(dú)詛咒了。

          年少時(shí)曾經(jīng)暗戀過的人,早已過上王子公主的幸福生活;

          年輕時(shí)深刻愛上的人,早已絕塵而去;

          多年來默默關(guān)懷自己的人,實(shí)在是不可以執(zhí)手相望;

          生命中匆匆過往的形形色色的男子,終究也是路人;

          于是這最年輕的年華,很是奇怪的,真的被孤獨(dú)詛咒了一樣。


          或許上帝開了個(gè)不小的玩笑,一個(gè)骨子里自視甚高的女子,一個(gè)曾經(jīng)對(duì)感情充滿無限幻想的
          人,卻在現(xiàn)實(shí)生活中不得不抬頭面對(duì)這樣慘淡而落寞的情路。從那個(gè)閉塞的小縣城,一步步
          走到今天,從來都相信通過自己的努力可以改變命運(yùn),但是這尷尬的情境,終于讓我懂得,
          有些事情確實(shí)不能如自己所計(jì)劃的實(shí)現(xiàn)。

          這已是我在大學(xué)里度過的第七個(gè)年頭,多年做學(xué)生的生涯終究要落下帷幕。身邊的人你來我
          往,變的總是別人的生活,不變的總是孤獨(dú)的自己。變的總是不同的生活軌跡,從家鄉(xiāng)的小
          縣城,到大連,從大連到京城,從京城到上海,不變的總是漫長(zhǎng)旅途中孤獨(dú)的身影。

          2006年的情人節(jié),境況依舊如往。這個(gè)城市有千萬朵玫瑰綻放,沒有一朵是為我而開。剛剛
          告別溫暖的家回校,中午時(shí)收到拒電,一份最為盼望的工作希望破滅,晚上去冷清的食堂吃
          了份冰冷的炒面。到了辦公室,空無一人,一種強(qiáng)烈的徹底的失敗感突然襲來,蔓延全身,
          感到了人生走到毫無希望和樂趣的地步,終于支撐不住,趴在桌子上,大哭一場(chǎng)。

          彷佛是被一張無形的巨網(wǎng)罩住,我不想過這樣的生活,可是為什么我總也擺脫不掉!


          將馬思洛的需求層次論用來解釋愛情,給朋友講的頭頭是道,被她評(píng)為最經(jīng)典和創(chuàng)意的愛情
          理論。我曾裝作老道的樣子,告誡她我們一定要尋找到滿足自己最高層次需求的一份感情,
          而如今的自己已再也不敢有此奢望。只求有一人,滿足自己安全的需要,交往的需要,擺脫
          漂泊感和恐懼感的需要。

          人在旅途時(shí),往往更加脆弱。每每奔波在路上,一個(gè)人趕車,候車,坐車,慢慢長(zhǎng)途中,看
          著身邊的旅伴們, 年輕的,年老的,互相照顧,我甚至覺得哪怕是隨便怎么樣一個(gè)人,陪
          在我身邊,為我拉個(gè)箱子,為我泡一碗面,或者為我掖掖被角,都能讓我萬分感動(dòng)。

          這次去上海,住華東理工我高中老友之女朋友宿舍內(nèi)。同屋另外一個(gè)女孩子,端莊秀氣,同
          樣借居于彼。考研、上班,與在上研的男友一起奮斗,薪酬甚為微薄,工作十分忙碌,生活
          極為艱辛。每日眾人酣睡之際,她已起身趕車,顛簸一個(gè)多小時(shí),在郊區(qū)一小診所作護(hù)士,
          每晚下班,要看書復(fù)習(xí)。臨近大考幾個(gè)月,男友每晚都陪她在自習(xí)室復(fù)習(xí)至深夜,再送她回
          來。

          然而造化弄人,連考兩年未果。我去當(dāng)晚,正逢女孩得知考研分?jǐn)?shù),難受的不知道怎么好。
          男友極為溫和,陪了她一整天,勸慰她不是她的原因,是自己查分的手太臭。兩人在外面站
          半天,回來時(shí)女孩本打算買個(gè)土家燒餅給男友吃,又覺得自己考的丟人,對(duì)不住他,不好意
          思再對(duì)他好,一扭頭跑了回來。

          我是躺在床上,默默地聽這個(gè)女孩子的敘述,想象2005年冬天的上海,房間里沒有一絲暖意
          ,那樣的生活.......這樣相濡以沫的愛情,我只是在幻想中有過。我知道女孩看我的眼神
          里,充滿了無限的羨慕,羨慕我的學(xué)業(yè)、前途如此一帆風(fēng)順,可是她不知道我對(duì)她的羨慕,
          每晚下班Tail看書復(fù)習(xí)。臨近大考幾個(gè)月,男友每晚都陪她在自習(xí)室復(fù)習(xí)至深夜,再送她回
          來。

          然而造化弄人,連考兩年未果。我去當(dāng)晚,正逢女孩得知考研分?jǐn)?shù),難受的不知道怎么好。
          男友極為溫和,陪了她一整天,勸慰她不是她的原因,是自己查分的手太臭。兩人在外面站
          半天,回來時(shí)女孩本打算買個(gè)土家燒餅給男友吃,又覺得自己考的丟人,對(duì)不住他,不好意
          思再對(duì)他好,一扭頭跑了回來。

          我是躺在床上,默默地聽這個(gè)女孩子的敘述,想象2005年冬天的上海,房間里沒有一絲暖意
          ,那樣的生活.......這樣相濡以沫的愛情,我只是在幻想中有過。我知道女孩看我的眼神
          里,充滿了無限的羨慕,羨慕我的學(xué)業(yè)、前途如此一帆風(fēng)順,可是她不知道我對(duì)她的羨慕,
          羨慕她如此幸運(yùn),有這樣一個(gè)心地純正的、這樣真心愛她的人。


          日子一天天總會(huì)過去,若不是立志獨(dú)身,將來總會(huì)遇見某個(gè)人,與之結(jié)婚,一起生活,幸福
          或者不幸福;若不出大的意外,將來總會(huì)有更多的錢,房子,車子,總歸會(huì)有這樣形式上完
          整的婚姻、丈夫,表面上熱鬧的生活。anyway,以后的生活與現(xiàn)在無關(guān)。但是這被孤獨(dú)詛咒
          了的一個(gè)女子最美好的青春歲月,會(huì)成為我一生中永遠(yuǎn)揮之不去的遺憾

          posted @ 2008-06-24 00:13 Vincent.Chen 閱讀(242) | 評(píng)論 (0)編輯 收藏

          關(guān)于ChartDirector的中文問題完美解決

          ChartDirector是一個(gè)圖表工具,類似JFreeChart,只是它是商業(yè)軟件。那為何還要用它?因?yàn)樗嫵鰜淼膱D表比JFreeChart精細(xì),好看得多。這好像是一個(gè)香港公司開發(fā)的?!http://www.advsofteng.com/
          它文檔上說了,它內(nèi)部采用UNICODE編碼。所以應(yīng)該不會(huì)有中文[非英文體系]亂碼問題。但是實(shí)際好像還是會(huì)出現(xiàn)亂碼,網(wǎng)上搜索了一通大多解決的不是很徹底,根據(jù)自己試驗(yàn)解決如下:
          1、
          JSP中增加:
          <%@ page contentType="text/html; charset=GB2312"%>
          //
          此處的charset要注意設(shè)置,也可設(shè)置成其他支持中文的編碼,然后注意保存的jsp文件要保存成相應(yīng)編碼
          //很多亂碼皆由于保存的編碼和這里聲明的編碼不一致導(dǎo)致[用EmEditor等工具保存時(shí)可以選擇編碼]
          //這里不聲明默認(rèn)采用ISO-8859-1編碼讀取,所以有網(wǎng)友說需要將中文編碼為ISO-8859-1即:
          //new String("中文".getBytes("ISO-8859-1"))

          2、設(shè)置Chart默認(rèn)字體:

          BaseChart.setDefaultFonts("simsun.ttc","simsun.ttc","simsun.ttc","simsun.ttc");

          如果在非windows系統(tǒng)下使用,可以拷貝windows系統(tǒng)下的simsun.ttc到classes路徑下,重啟服務(wù)器即可顯示中文

          然后其他的一些字體大小等都要一個(gè)個(gè)設(shè)置了,因?yàn)槟J(rèn)英文字體大小顯示中文不好看

          這樣就可以很完美顯示中文了。比起JFreeChart來好多了,JFreeChart雖然也可以解決中文顯示問題,但是中文字體發(fā)虛,好像目前無法解決。

          posted @ 2008-04-15 20:06 Vincent.Chen 閱讀(5425) | 評(píng)論 (5)編輯 收藏

          Topsite

               摘要:   閱讀全文

          posted @ 2008-04-12 09:28 Vincent.Chen 閱讀(401) | 評(píng)論 (0)編輯 收藏

          WareZ

               摘要:   閱讀全文

          posted @ 2008-04-12 09:28 Vincent.Chen 閱讀(491) | 評(píng)論 (0)編輯 收藏

          WAREZ無形帝國(guó)

               摘要:   閱讀全文

          posted @ 2008-04-12 09:25 Vincent.Chen 閱讀(241) | 評(píng)論 (0)編輯 收藏

          WareZ與0Day的故事- -

               摘要:   閱讀全文

          posted @ 2008-04-12 09:21 Vincent.Chen 閱讀(537) | 評(píng)論 (0)編輯 收藏

          在windows上用源代碼編譯安裝MPlayer【轉(zhuǎn)載】

               摘要:   閱讀全文

          posted @ 2008-04-02 21:38 Vincent.Chen 閱讀(4231) | 評(píng)論 (0)編輯 收藏

          轉(zhuǎn):利用JFreeChart繪制股票K線圖完整解決方案

               摘要:   閱讀全文

          posted @ 2008-02-02 20:49 Vincent.Chen 閱讀(3418) | 評(píng)論 (0)編輯 收藏

          JFreeChart庫(kù)包的簡(jiǎn)介【轉(zhuǎn)載】

               摘要:   閱讀全文

          posted @ 2008-02-02 20:41 Vincent.Chen 閱讀(420) | 評(píng)論 (0)編輯 收藏

          JFreeChart中文文檔【轉(zhuǎn)載】

               摘要:   閱讀全文

          posted @ 2008-02-02 20:34 Vincent.Chen 閱讀(856) | 評(píng)論 (0)編輯 收藏

          [轉(zhuǎn)載]個(gè)人對(duì)400余部影片的觀后感(純主觀)

               摘要:   閱讀全文

          posted @ 2008-01-20 22:01 Vincent.Chen 閱讀(36499) | 評(píng)論 (17)編輯 收藏

          DVDrip、HDrip、BDrip等 知識(shí)資料匯總

               摘要:   閱讀全文

          posted @ 2008-01-19 04:08 Vincent.Chen 閱讀(608) | 評(píng)論 (0)編輯 收藏

          AppFuse2 建立新project命令

          ArchetypeCommand
          JSF Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Spring MVC Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Struts 2 Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Tapestry Basic mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-basic-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          JSF Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-jsf -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Spring MVC Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-spring -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Struts 2 Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-struts -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Tapestry Modular mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-modular-tapestry -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject
          Core
          (backend only)
          mvn archetype:create -DarchetypeGroupId=org.appfuse -DarchetypeArtifactId=appfuse-core -DremoteRepositories=http://static.appfuse.org/repository -DarchetypeVersion=2.0-m5 -DgroupId=com.mycompany.app -DartifactId=myproject

          posted @ 2007-07-18 22:58 Vincent.Chen 閱讀(1035) | 評(píng)論 (0)編輯 收藏

          候捷談反射機(jī)制(轉(zhuǎn))

               摘要: Reflection 是Java被視為動(dòng)態(tài)(或準(zhǔn)動(dòng)態(tài))語言的一個(gè)關(guān)鍵性質(zhì)。這個(gè)機(jī)制允許程序在運(yùn)行時(shí)透過Reflection APIs取得任何一個(gè)已知名稱的class的內(nèi)部信息,包括其modifiers(諸如public, static 等等)、superclass(例如Object)、實(shí)現(xiàn)之interfaces(例如Cloneable),也包括fields和methods的所有信息,并可于運(yùn)行時(shí)改變fields內(nèi)容或喚起methods。本文借由實(shí)例,大面積示范Reflection APIs。  閱讀全文

          posted @ 2007-07-02 23:58 Vincent.Chen 閱讀(794) | 評(píng)論 (0)編輯 收藏

          (轉(zhuǎn))Polymorphism(多態(tài)性)很X,大家注意少兒不宜

               摘要: Polymorphism shouldn't be a new concept to anybody. You deal with it every day in the real world. There's more than one class of cat to skin, but you skin 'em the same way, even if the specific instance is completely new to you. Let's say for example you want to fuck a hole. You fuck all holes the same. You don't care if that hole happens to be a mouth, an ass, or a pussy, you're gonna fuck it the same way regardless. However, the mouth, pussy, or ass may respond differently to the fucking.  閱讀全文

          posted @ 2007-07-02 23:54 Vincent.Chen 閱讀(2135) | 評(píng)論 (1)編輯 收藏

          Eclipse Europa發(fā)布。。。

          Eclipse Europa is the annual release of Eclipse projects. Like last year’s Callisto release, the Europa release is a coordinated release of different Eclipse project teams. This year, the annual release includes 21 projects. By releasing these projects at the same time, the goal is to eliminate uncertainty about version compatibility and make it easier to incorporate multiple projects into your environment.

          While Europa is about the simultaneous release of twenty one projects, it is not a unification of the projects - each project remains a separate open source project operating with its own project leadership, its own committers, and its own project plan.

           

          posted @ 2007-06-29 00:19 Vincent.Chen 閱讀(568) | 評(píng)論 (0)編輯 收藏

          Look'N'Stop規(guī)則包

          確實(shí)很強(qiáng)大,提供網(wǎng)上的規(guī)則包下載
          Lns規(guī)則20060614.rar
          wifi_secure

          posted @ 2007-06-07 00:01 Vincent.Chen 閱讀(4585) | 評(píng)論 (1)編輯 收藏

          WebWork學(xué)習(xí)小記

          1、集成各種view
          推薦直接使用 result type 集成
          2、在集成freemarker時(shí)候需要注意:
          ? 1)<#assign ww=JspTaglibs["/WEB-INF/lib/webwork.tld"] />已不用因?yàn)?/span>webwork2.2的freemarker的tag支持是內(nèi)置的,
          ? 2)${wwUtil}已換成${webwork}
          3、使用sitemesh時(shí),一般推薦使用其PageFilter得擴(kuò)展。
          ? 1)Velocity:VelocityPageFilter
          ? 2)Freemarker:
          FreeMarkerPageFilter
          ? 3)ActionContextCleanUp的作用是告訴會(huì)通知FilterDispatcher在正確的時(shí)間清除請(qǐng)求.否則,ActionContext將在SiteMesh修飾器訪問數(shù)據(jù)之前被清除.
          ? ∴ 使用的時(shí)候web.xml加聲明(順序很重要)
          <filter>
          <filter-name>webwork-cleanup</filter-name>
          <filter-class>
          ?? com.opensymphony.webwork.dispatcher.ActionContextCleanUp
          </filter-class>
          </filter>
          <filter>
          <filter-name>sitemesh</filter-name>
          <!--?此處的XXX為Velocity或FreeMarker,根據(jù)實(shí)際而定?-->
          <filter-class>com.opensymphony.webwork.sitemesh.XXXPageFilter</filter-class>
          </filter>
          <filter>
          <filter-name>webwork</filter-name>
          <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class>
          </filter>

          <filter-mapping>
          <filter-name>webwork-cleanup</filter-name>
          <url-pattern>/*</url-pattern>
          </filter-mapping>
          <filter-mapping>
          <filter-name>sitemesh</filter-name>
          <url-pattern>/*</url-pattern>
          </filter-mapping>
          <filter-mapping>
          <filter-name>webwork</filter-name>
          <url-pattern>/*</url-pattern>
          </filter-mapping>

          posted @ 2006-06-04 17:02 Vincent.Chen 閱讀(802) | 評(píng)論 (0)編輯 收藏

          關(guān)于ResultSet的關(guān)閉問題

          在Connection上調(diào)用close方法會(huì)關(guān)閉Statement和ResultSet嗎?

          級(jí)聯(lián)的關(guān)閉這聽起來好像很有道理,而且在很多地方這樣做也是正確的,通常這樣寫
          Connection con = getConnection();//getConnection is your method
          PreparedStatement ps = con.prepareStatement(sql);
          ResultSet rs = ps.executeQuery();
          ……
          ///rs.close();
          ///ps.close();
          con.close();  // NO!
          這 樣做的問題在于Connection是個(gè)接口,它的close實(shí)現(xiàn)可能是多種多樣的。在普通情況下,你用 DriverManager.getConnection()得到一個(gè)Connection實(shí)例,調(diào)用它的close方法會(huì)關(guān)閉Statement和 ResultSet。但是在很多時(shí)候,你需要使用數(shù)據(jù)庫(kù)連接池,在連接池中的得到的Connection上調(diào)用close方法的時(shí)候,Connection可能并沒有被釋放,而是回到了連接池中。它以后可能被其它代碼取出來用。如果沒有釋放Statement和ResultSet,那么在Connection上沒有關(guān)閉的Statement和ResultSet可能會(huì)越來越多,那么……
          相反,我看到過這樣的說法,有人把Connection關(guān)閉了,卻繼續(xù)使用ResultSet,認(rèn)為這樣是可以的,引發(fā)了激烈的討論,到底是怎么回事就不用我多說了吧。

          所以我們必須很小心的釋放數(shù)據(jù)庫(kù)資源,下面的代碼片斷展示了這個(gè)過程

          Connection con = null;
          PreparedStatement ps = null;
          ResultSet rs = null;

          try {
              con = getConnection();//getConnection is your method
              ps = con.prepareStatement(sql);
              rs = ps.executeQuery();
              ///...........
          }
          catch (SQLException ex) {
              ///錯(cuò)誤處理
          }
          finally{
              try {
                  if(ps!=null)
                      ps.close();
              }
              catch (SQLException ex) {
                  ///錯(cuò)誤處理
              }
              try{
                  if(con!=null)
                      con.close();
              }
              catch (SQLException ex) {
                  ///錯(cuò)誤處理
              }
          }

          很麻煩是不是?但為了寫出健壯的程序,這些處理是必須的。



          上面這東西講得真是精辟。

          posted @ 2006-03-15 23:15 Vincent.Chen 閱讀(4383) | 評(píng)論 (0)編輯 收藏

          custom swt widgets, a list...(轉(zhuǎn))

          Everybody knows that the basic native widgets in swt lack a lot of flexibility and features. An approach to solve these shortcomings is to build custom swt widgets that do not rely on native widgets but are custom drawn - the same approach that swing took. A good example is KTable. The custom swt widgets - custom drawn and aggergated native ones - I currently know of are:

          • swtplus: http://swtplus.textdriven.com/
            • PGroup: an expandable group widget
            • PLink: an image hyperlink widget
          • Jaret: http://www.jaret.de/index.html
            • timebars: a widget showing intervals in a Gantt chart. The widget implementation is combined for JFC/Swing and the SWT toolkit. Learn more about the timebar widget and it's features here. LICENSE: GPL (commercial license available)
            • table: custom drawn table widget for the SWT toolkit.
            • datechooser: a widget for selecting dates in a classical drop down style featuring the display of holidays and other special days. Learn more
          • novocode: http://www.novocode.com/swt/
            • CustomSeparator: Instances of this class are non-native separator lines.
            • FramedComposite: Instances of this class are composites with a border around the contents.
            • Hyperlink: A hyperlink text label.
            • LiveSashForm: Like a regular SashForm, the LiveSashForm lays out its children in a Row or Column
            • SizeGrip: A non-native size grip which looks (and almost feels) like the native Win32 size grip.
          • Ktable: http://sourceforge.net/projects/ktable
            • KTable is a custom SWT table widget that provides a flexible grid of cells to display data. Since it is custom-drawn, it does not have the restrictions of the native SWT Table control.
          • Gface: http://gface.sourceforge.net/
            • Search Box - Searchable drop-down list
            • Date Picker - UI widget for visually picking a day in a month.
            • Date Combo - Combo box that opens the date picker to select date
            • Hour Selection Combo - CCombo to select hour in a day
          • SWT Dock: http://tweetypie.doc.ic.ac.uk/~jr200/twiki/bin/view/SWTDock/WebHome
            • Eclipse Docking API (2.1) ported back to Java from .NET.

          posted @ 2006-02-21 22:39 Vincent.Chen 閱讀(1098) | 評(píng)論 (0)編輯 收藏

          一個(gè)高效簡(jiǎn)潔的Struts分頁方法

           

          posted @ 2006-02-14 21:27 Vincent.Chen 閱讀(588) | 評(píng)論 (0)編輯 收藏

          XSL 學(xué)習(xí)筆記 —— 中級(jí)篇

            

          posted @ 2006-02-14 21:26 Vincent.Chen 閱讀(517) | 評(píng)論 (0)編輯 收藏

          XSL 學(xué)習(xí)筆記 —— 基礎(chǔ)篇

           

          posted @ 2006-02-14 21:24 Vincent.Chen 閱讀(576) | 評(píng)論 (0)編輯 收藏

          GOOGLE挑戰(zhàn)賽練習(xí)題1及答案(200分)

           

          posted @ 2006-02-14 21:23 Vincent.Chen 閱讀(682) | 評(píng)論 (0)編輯 收藏

          GOOGLE挑戰(zhàn)賽練習(xí)題2及答案(500分)

           

          posted @ 2006-02-14 21:18 Vincent.Chen 閱讀(599) | 評(píng)論 (0)編輯 收藏

          如何把a(bǔ)wt或者swing的UI生成一個(gè)圖形文件

           

          posted @ 2006-02-14 21:17 Vincent.Chen 閱讀(391) | 評(píng)論 (0)編輯 收藏

          三步搞定!水貨商坦言IBM本本驗(yàn)貨指南

           

          posted @ 2006-02-14 21:16 Vincent.Chen 閱讀(349) | 評(píng)論 (0)編輯 收藏

          GOOGLE挑戰(zhàn)賽練習(xí)題3及答案(1000分)

           

          posted @ 2006-02-14 21:15 Vincent.Chen 閱讀(376) | 評(píng)論 (0)編輯 收藏

          關(guān)于分頁設(shè)計(jì)的一些做法

           

          posted @ 2006-02-14 21:12 Vincent.Chen 閱讀(342) | 評(píng)論 (0)編輯 收藏

          JDBC實(shí)現(xiàn)oracle blob 出庫(kù)入庫(kù)


          posted @ 2006-02-14 21:02 Vincent.Chen 閱讀(500) | 評(píng)論 (0)編輯 收藏

          https相關(guān)


          posted @ 2006-02-14 21:01 Vincent.Chen 閱讀(306) | 評(píng)論 (0)編輯 收藏

          學(xué)習(xí)Log4J筆記(轉(zhuǎn))

           

          posted @ 2006-02-13 18:19 Vincent.Chen 閱讀(347) | 評(píng)論 (0)編輯 收藏

          KMplayer常見問題整理

           

          posted @ 2006-02-12 22:55 Vincent.Chen 閱讀(506) | 評(píng)論 (0)編輯 收藏

          Velocity用戶手冊(cè)---中文版

           

          posted @ 2006-02-12 12:59 Vincent.Chen 閱讀(516) | 評(píng)論 (0)編輯 收藏

          在網(wǎng)上看到華為java的面試題

           

          posted @ 2006-02-12 11:10 Vincent.Chen 閱讀(1049) | 評(píng)論 (1)編輯 收藏

          昨天收到的email(轉(zhuǎn):還蠻搞笑)

          本郵件為公益郵件,非營(yíng)利。隨緣而發(fā),若您有緣收到,讀完全文,心生歡喜,那是您與佛有緣;如果您能將此郵件轉(zhuǎn)發(fā)給10個(gè)以上的好友,讓益世文選流通世上,您將得蒙菩薩慈護(hù),福壽綿延,家運(yùn)日隆
          閱讀全文

          posted @ 2006-02-12 11:08 Vincent.Chen 閱讀(446) | 評(píng)論 (0)編輯 收藏

          prototype.js開發(fā)筆記

          Prototype是什么?

          或許你還沒有用過它, prototype.js 是一個(gè)由Sam Stephenson寫的JavaScript包。這個(gè)構(gòu)思奇妙編寫良好的一段兼容標(biāo)準(zhǔn)的一段代碼將承擔(dān)創(chuàng)造胖客戶端, 高交互性WEB應(yīng)用程序的重?fù)?dān)。輕松加入Web 2.0特性。

          如果你最近體驗(yàn)了這個(gè)程序包,你很可能會(huì)發(fā)現(xiàn)文檔并不是它的強(qiáng)項(xiàng)之一。像所有在我之前的開發(fā)者一樣,我只能一頭扎進(jìn)prototype.js的源代碼中并且試驗(yàn)其中的每一個(gè)部分。 我想當(dāng)我學(xué)習(xí)他的時(shí)候記寫筆記然后分享給其他人將會(huì)很不錯(cuò)。

          查看全文

          posted @ 2006-02-12 11:06 Vincent.Chen 閱讀(422) | 評(píng)論 (0)編輯 收藏

          prototype1.3.1源代碼解讀

           

          posted @ 2006-02-12 11:04 Vincent.Chen 閱讀(431) | 評(píng)論 (0)編輯 收藏

          竹筍炒肉之Junit學(xué)習(xí)筆記(轉(zhuǎn))

          JUnit是由 Erich Gamma 和 Kent Beck 編寫的一個(gè)回歸測(cè)試框架(regression testing framework),供Java開發(fā)人員編寫單元測(cè)試之用。

          查看全文


          posted @ 2006-02-12 10:53 Vincent.Chen 閱讀(444) | 評(píng)論 (0)編輯 收藏

          MySQL的配置與使用

          1、??? 啟動(dòng) MySQL

          c:\mysql\bin\ 下運(yùn)行 winmysqladmin 啟動(dòng)

          2、??? 登錄 MySQL

          初始情況下默認(rèn)登錄用戶名 root ,密碼為空。

          c:\mysql\bin 下運(yùn)行 mysql -uroot 即可。當(dāng)我們新建用戶之后按以下方式:

          mysql -h(hostname) -u(username) -p(password)

          3、??? 使用數(shù)據(jù)庫(kù)

          初始安裝之后有一個(gè)保存系統(tǒng)表的數(shù)據(jù)庫(kù)—— mysql ,使用以下命令可以訪問數(shù)據(jù)庫(kù)

          use mysql;

          4、??? 新建 MySQL 用戶

          root 帳號(hào)登錄后,進(jìn)入 mysql 數(shù)據(jù)庫(kù),執(zhí)行插入語句:

          insert into user (host,user,password) values('localhost','mysql',password('mysql'));

          insert into user (host,user,password) values('%','mysql',password('mysql'));

          flush privileges;

          ?

          這樣就為 MySQL 建立了一個(gè)名為 mysql ,密碼為 mysql 的用戶,第一個(gè)用于本地登錄,第二個(gè)用于遠(yuǎn)程登錄。

          <! 注意 : user (host,user,password) 之間必須有空格隔開 >

          <! 注意 : values ('','','') 之間沒有空格隔開,字符串用單引號(hào) >

          5、??? 新建數(shù)據(jù)庫(kù)

          create database test;

          6、??? 退出

          quit;

          7、??? 幾個(gè)有用的 SQL 命令:

          2??????? show databases :在剛登錄之后、使用數(shù)據(jù)庫(kù)之前查看現(xiàn)有數(shù)據(jù)庫(kù);

          2??????? select database 顯示當(dāng)前數(shù)據(jù)庫(kù)

          2??????? show tables 顯示當(dāng)前數(shù)據(jù)庫(kù)中的所有表

          describe table_name :顯示某表的結(jié)構(gòu)

          8、??? 備份與恢復(fù)

          mysqldump -u username -p --opt? dbname >backupfileName.sql :將數(shù)據(jù)庫(kù)dbname導(dǎo)出到 backupfileName.sql文件中

          mysql dbname < backupfileName.sql:做反向工作。



          posted @ 2006-02-09 00:06 Vincent.Chen 閱讀(724) | 評(píng)論 (2)編輯 收藏

          轉(zhuǎn)載:oracle中的函數(shù)

          Oracle已經(jīng)內(nèi)建了許多函數(shù),不同的函數(shù)有不同的作用和用法,有的函數(shù)只能作用在一個(gè)記錄行上,有的能夠作用在多個(gè)記錄行上,不同的函數(shù)可能處理不同的數(shù)據(jù)類型。常見的有兩類,單行函數(shù)和分組函數(shù) 。

             查看全文

          posted @ 2006-01-18 00:34 Vincent.Chen 閱讀(537) | 評(píng)論 (0)編輯 收藏

          轉(zhuǎn)載:Tree2實(shí)踐

          通過一次小小的實(shí)踐,終于了解如何使用tomahawk中的tree2這個(gè)組件了,并且寫了小段程序,從xml中讀取樹的結(jié)構(gòu),生成一個(gè)tree,不過tree2不能直接和xml綁定是一個(gè)遺憾,那樣就會(huì)省不少事情了。記下一點(diǎn)心得,以供后來參考了。

                   對(duì)tree2的操作分為兩部分,一部分是在頁面中通過tag定義樣式相關(guān)的東西,一部分就是通過編程添加樹的節(jié)點(diǎn),起初看了sample以后總是以為這東西有多么的復(fù)雜,其實(shí)邏輯是很簡(jiǎn)單的,只是sample中定義了多種不同的樣式的節(jié)點(diǎn),看上去很復(fù)雜而已。

          下面附上我對(duì)sample簡(jiǎn)化過的這段tag來說明一下。

          <t:tree2 value="#{catalog.node}" var="node" id="clientside" varNodeToggler="t" >

              <f:facet name="folder">

                  <h:panelGroup>

                      <f:facet name="expand">

                          <t:graphicImage value="images/yellow-folder-open.png" rendered="#{t.nodeExpanded}" border="0"/>

                      </f:facet>

                      <f:facet name="collapse">

                          <t:graphicImage value="images/yellow-folder-closed.png" rendered="#{!t.nodeExpanded}" border="0"/>

                      </f:facet>

                      <h:outputText value="#{node.description}"/>

                  </h:panelGroup>

              </f:facet>

          </t:tree2>

          tree2的主tag定義了tree的根節(jié)點(diǎn)和一些相關(guān)的參數(shù)。嵌套的那個(gè)facet定義了一種節(jié)點(diǎn)的樣式,包括展開與關(guān)閉時(shí)的圖片,以及顯示的文字內(nèi)容。

          在程序里面,我們root TreeNodeBase = new TreeNodeBase(…)來創(chuàng)建一個(gè)root節(jié)點(diǎn),然后通過root.getChildren().add(new TreeNodeBase(…))為其添加子節(jié)點(diǎn),任何一個(gè)節(jié)點(diǎn)都可以添加任意多的子節(jié)點(diǎn),通過這樣的操作,我們可以很容易的生成一個(gè)tree的結(jié)構(gòu)了,實(shí)際上,這個(gè)tree的結(jié)構(gòu)是通過遞歸從xml中讀取出來,生成一個(gè)和xml tree完全相同的結(jié)構(gòu)。

          除了明白如何去用這個(gè)tree2之外的收獲就是,終于明白了如何去通過遞歸方法遍歷一個(gè)樹形結(jié)構(gòu),雖然在學(xué)校里學(xué)過遍歷的算法,也抄過例程,但從來沒有理解過是怎么一回事,終于在實(shí)踐中理解了,實(shí)踐才是軟件的根本之道。
             程序的其它部分放在附件里面了,如果有興趣了可以和我討論tree2,討論其它JSF的東西。

          源文件下載

          查看 解析Tree2 全文

          posted @ 2006-01-14 03:43 Vincent.Chen 閱讀(646) | 評(píng)論 (0)編輯 收藏

          高級(jí) SQL(轉(zhuǎn)載:約束+觸發(fā)器)

          用約束和觸發(fā)器實(shí)施商業(yè)規(guī)則

          在商界,我們的確通常需要確保始終實(shí)施某些規(guī)則。例如,參與項(xiàng)目的雇員必須被雇用。或者想要某些事件有計(jì)劃地發(fā)生。例如,如果銷售員售出一批商品,則應(yīng)增加其傭金。

          DB2 通用數(shù)據(jù)庫(kù)為此提供了一套有用的方法。 唯一約束是禁止在表的一列或多列中出現(xiàn)重復(fù)值的規(guī)則。 參考完整性約束確保在整個(gè)指定的表中數(shù)據(jù)一致性。 表檢查約束是一些條件,它們定義為表定義的一部分,限制一列或多列中使用的值。觸發(fā)器允許您定義一組操作,這些操作通過對(duì)指定的表進(jìn)行刪除、插入或更新操作來執(zhí)行或觸發(fā)。觸發(fā)器可用于寫入其他表、修改輸入值以及發(fā)布警報(bào)信息。

          查看全文

          posted @ 2006-01-10 23:42 Vincent.Chen 閱讀(614) | 評(píng)論 (0)編輯 收藏

          Eclipse 3 插件大全

          1.MyEclipse  J2EE開發(fā)插件,支持SERVLET/JSP/EJB/數(shù)據(jù)庫(kù)操縱等
          www.myeclipseide.com
           
          2.Properties Editor  編輯java的屬性文件,并可以自動(dòng)存盤為Unicode格式
          http://propedit.sourceforge.jp/index_en.html
           
          3.Colorer Take  為上百種類型的文件按語法著色
          http://colorer.sourceforge.net/
           
          4.XMLBuddy 編輯xml文件
          www.xmlbuddy.com
           
          5.Code Folding  加入多種代碼折疊功能(比eclipse自帶的更多)
          http://www.coffee-bytes.com/servlet/PlatformSupport
           
          6.Easy Explorer  從eclipse中訪問選定文件、目錄所在的文件夾
          http://easystruts.sourceforge.net/
           
          7.Fat Jar 打包插件,可以方便的完成各種打包任務(wù),可以包含外部的包等
          http://fjep.sourceforge.net/
           
          8.RegEx Test 測(cè)試正則表達(dá)式
          http://brosinski.com/stephan/archives/000028.php
           
          9.JasperAssistant 報(bào)表插件(強(qiáng),要錢的)
          http://www.jasperassistant.com/
           
          10.Jigloo GUI Builder JAVA的GUI編輯插件
          http://cloudgarden.com/jigloo/
           
          11.Profiler 性能跟蹤、測(cè)量工具,能跟蹤、測(cè)量BS程序
          http://sourceforge.net/projects/eclipsecolorer/
           
          12.AdvanQas 提供對(duì)if/else等條件語句的提示和快捷幫助(自動(dòng)更改結(jié)構(gòu)等)
          http://eclipsecolorer.sourceforge.net/advanqas/index.html
           
          13.Log4E     Log4j插件,提供各種和Log4j相關(guān)的任務(wù),如為方法、類添加一個(gè)logger等
          http://log4e.jayefem.de/index.php/Main_Page
           
          14.VSSPlugin VSS插件
          http://sourceforge.net/projects/vssplugin
           
          15.Implementors   提供跳轉(zhuǎn)到一個(gè)方法的實(shí)現(xiàn)類,而不是接中的功能(實(shí)用!)
          http://eclipse-tools.sourceforge.net/implementors/
           
          16.Call Hierarchy 顯示一個(gè)方法的調(diào)用層次(被哪些方法調(diào),調(diào)了哪些方法)
          http://eclipse-tools.sourceforge.net/call-hierarchy/index.html
           
          17.EclipseTidy 檢查和格式化HTML/XML文件
          http://eclipsetidy.sourceforge.net/
           
          18.Checkclipse 檢查代碼的風(fēng)格、寫法是否符合規(guī)范
          http://www.mvmsoft.de/content/plugins/checkclipse/checkclipse.htm
           
          19.Hibernate Synchronizer Hibernate插件,自動(dòng)映射等
          http://www.binamics.com/hibernatesync/
           
          20.VeloEclipse  Velocity插件
          http://propsorter.sourceforge.net/
           
          21.EditorList   方便的列出所有打開的Editor
          http://editorlist.sourceforge.net/
           
          22.MemoryManager 內(nèi)存占用率的監(jiān)視
          http://cloudgarden.com/memorymanager/

          posted @ 2005-12-31 18:38 Vincent.Chen 閱讀(873) | 評(píng)論 (1)編輯 收藏

          主站蜘蛛池模板: 新绛县| 南江县| 兴安县| 疏附县| 名山县| 尚义县| 临沭县| 乌兰浩特市| 古田县| 黎川县| 叶城县| 阳曲县| 黑山县| 左云县| 图片| 湘西| 鄯善县| 自治县| 什邡市| 嘉兴市| 襄汾县| 防城港市| 商丘市| 海林市| 汽车| 大化| 金乡县| 迁安市| 宣城市| 比如县| 聂荣县| 屯留县| 莱西市| 衡水市| 武城县| 五华县| 天峨县| 威信县| 桐梓县| 兴仁县| 娱乐|