Archive

2009年5月 的Archive

MS SQL Server 設定Trigger 語法

2009年5月13日 尚無評論

今天剛好有網友詢問如何設定MSSQL Server 的Trigger
所以就把相關設定寫下來

這trigger 的動作是希望在有異動資料時
能將原本的資料及異動的資料都寫到log 去

所以就如下面這串啦

CREATE TRIGGER tritest ON [dbo].[fee]
FOR Update
AS
   INSERT INTO [dbo].log1(modifier,updateTime) SELECT modifier, GETDATE() FROM INSERTED
  INSERT INTO [dbo].log2(modifier,updateTime) SELECT modifier, GETDATE() FROM DELETED

這和Mysql 不太一樣的是 sqlserver提供了inserted及deleted 兩個temp table,當有異動資料觸發時
inserted會放新的資料而deleted會保有被修改或被刪除的資料

Categories: Database Tags: ,

URL 中文顯示處理 for Java

2009年5月13日 尚無評論

最近常會需要把中文直接顯示在URL上,方便使用者及搜尋引擎辨識
不過後來發現,直接將中文顯示於網頁連結時,如使用者直接點選是ok的

但如果使用者用複製URL連結 再自行至IE 貼上再連結就會出現亂碼啦

在FireFox上使用時,如上述動作他會自動將中文轉成unicode碼所以會讓這url 可以執行
但如果是從其它地方copy中文連結貼上,也會是亂碼…看來還是只能把URL的中文進行轉碼才行

在Java 可以透過

java.net.URLEncoder.encode(keyword,”UTF-8″)

進行轉碼,這樣在url 連結雖會顯示unicode碼,但至少上述動作都能正常
不知搜尋引擎會不會辨識這文字呢?

此外,要注意的是,在測試時 URLEncoder.encode()時 如沒有帶入”UTF-8″
轉出的Unicode碼是無法使用的…怪~以前記憶中是可以的
反正大家如在try 時,不行就和我一樣加上”UTF-8″吧!!

Categories: JAVA Tags: , ,

結婚婚禮歌曲-江蕙-炮仔聲

2009年5月11日 尚無評論

這首歌是在網路看到有婚攝拿來進行迎娶MV的配樂
從拜別,上禮車丟扇車,搭配著炮仔聲的音樂
光聽歌曲就很有畫面,再搭配這首可以更讓人感動呀!!

如果有迎娶MV要在喜宴上播放,可以安排在第一次進場後
搭配播放,最後再配上親友的留言祝福,一定溫馨到讓人眼淚不掉也難呀!!

這首歌如參考連結作者所說,也很適合放在第二次進場的時候播放,
並搭配上感恩父母的活動,氣氛一定很棒、很溫馨。

炮仔聲/演唱:江蕙/詞:黃士佑/曲:森佑士

紅紅的蠟燭,雪白的新娘裳,夢境變作真正,
粗粗的雙手,疼阮到這大,幸福紅毯送阮來行.
歡喜的眼神,參著寂寞的背影,嘸甘藏置叮嚀話下腳,
抹凍擱定定,惦恁身邊來陪伴,是壓咧心頭尚重的牽掛.

炮仔聲  摧阮著來起行,這雙腳千斤重嘸肯行,
難捨目屎早就已經滿,塞咧吶喉感恩喊無聲.
炮仔聲  講出阮的心晟,爸爸媽媽身體愛保重啊,
千言萬語綿綿的感謝,寄託炮仔一聲又一聲.

學行叫阿爸,學唱囝仔歌,情景干像昨日啊,
落落的身影,疼阮若生命,愛惜的相片早就一大疊.
原諒查某子,感恩友孝到一半,做人牽手人生欲來行,
上煩惱阿爸,寂寞嘸甘講出聲,思念阮的歌阮隨時返來聽.

炮仔聲  摧咱著來起行,嘸甘藏置嘴唇內底咬,
大喜日子目屎擦乎乾,兩人四腳人生鬥打拼.
炮仔聲  歡喜欲來起行,有日頭有時嘛會瀛厊,
眾人祝福收惦咧心肝 ,白頭有愛什覓攏嘸驚.


希望早日倘有紅蛋吃,椅仔搖搖抱孫含糖仔

參考連結:
http://www.wretch.cc/blog/patrica/3985756
http://www.youtube.com/watch?v=-X6CIvf67vg

Categories: 好歌 Tags: , ,

如何調整Windows上的Tomcat服務參數

2009年5月9日 尚無評論

如果要調整安裝在Windows 上Tomcat服務的參數可以在console mode執行以下指令即可進行更改啟動參數

C:\> tomcat6 //US//Tomcat6 –Description=”Apache Tomcat Server – http://tomcat.apache.org/ ” \
C:\> –Startup=auto –Classpath=%JAVA_HOME%\lib\tools.jar;%CATALINA_HOME%\bin\bootstrap.jar \
C:\> –JvmMx=512

重點在於使用 //US// (Update service parameters)  指令進行更新參數作業,可使用詳細參數如下:

ParameterName Default Description
–Description Service name description (maximum 1024 characters)
–DisplayName ServiceName Service display name
–Install procrun.exe //RS//ServiceName Install image
–Startup manual Service startup mode can be either auto or manual
–DependsOn List of services that this service depend on. Dependent services are separated using either # or ; characters
–Environment List of environment variables that will be provided to the service in the form key=value. They are separated using either # or ; characters
–User User account used for running executable. It is used only for StartMode java or exe and enables running applications as service under account without LogonAsService privilege.
–Password Password for user account set by –User parameter
–JavaHome JAVA_HOME Set a different JAVA_HOME then defined by JAVA_HOME environment variable
–Jvm auto Use either auto or specify the full path to the jvm.dll. You can use the environment variable expansion here.
–JvmOptions -Xrs List of options in the form of -D or -X that will be passed to the JVM. The options are separated using either # or ; characters.
–Classpath Set the Java classpath
–JvmMs Initial memory pool size in MB
–JvmMx Maximum memory pool size in MB
–JvmSs Thread stack size in KB
–StartImage Executable that will be run.
–StartPath Working path for the start image executable.
–StartClass Class that will be used for startup.
–StartParams List of parameters that will be passed to either StartImage or StartClass. Parameters are separated using either # or ; character.
–StartMethod Main Method name if differs then main
–StartMode executable Can one of jvm java or exe
–StopImage Executable that will be run on Stop service signal.
–StopPath Working path for the stop image executable.
–StopClass Class that will be used on Stop service signal.
–StopParams List of parameters that will be passed to either StopImage or StopClass. Parameters are separated using either # or ; character.
–StopMethod Main Method name if differs then main
–StopMode executable Can one of jvm java or exe
–StopTimeout No Timeout Defines the timeout in seconds that procrun waits for service to exit gracefully.
–LogPath working path Defines the path for logging
–LogPrefix jakarta_service Defines the service log filename
–LogLevel INFO Defines the logging level and can be either error, info, warn or debug
–StdOutput Redirected stdout filename
–StdError Redirected stderr filename

請依版本參考相關文件:
http://tomcat.apache.org/tomcat-5.5-doc/windows-service-howto.html
http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html

Categories: 系統設定 Tags: , ,

結婚婚禮歌曲-梁靜茹-大手拉小手

2009年5月8日 尚無評論

這首歌蠻適合製作MV用的,輕快的節奏,讓人心情舒爽
句句浪漫而且充滿愛的歌詞內容,加上梁靜茹的好歌喉
讓人聽起來真的有甜在心的感覺
很容意就能勾起歡樂的回憶,快來聽聽北~^^

梁靜茹 小手拉大手 歌詞

小手拉大手

*還記得那場音樂會的煙火 還記得那個涼涼的深秋
 還記得人潮把你推向了我 遊樂園擁擠的正是時候

 一個夜晚堅持不睡的等候 一起泡溫泉奢侈的享受

 有一次日記裡愚蠢的困惑 因為你的微笑幻化成風
#你大大的勇敢保護著我 我小小的關懷喋喋不休

 感謝我們一起走了那麼久 又再一起回到涼涼(的)深秋

@給你我的手 像溫柔野獸 把自由交給草原的遼闊(我們一直就這樣向前走)
 我們小手拉大手 一起郊遊 今天別想太多

 你是我的夢 像北方的風 吹著南方暖洋洋的哀愁

 我們小手拉大手 今天加油 向昨天揮揮手
REPEAT*#@@
今天為我加油 捨不得揮揮手

@給你我的手 像溫柔野獸 把自由交給草原的遼闊(我們一直就這樣向前走)
 我們小手拉大手 一起郊遊 今天別想太多

 你是我的夢 像北方的風 吹著南方暖洋洋的哀愁

 我們小手拉大手 今天加油 向昨天揮揮手
REPEAT*#@@
今天為我加油 捨不得揮揮手

歌詞出處 – http://asd159.blog.ithome.com.tw/post/718/7300
MV出處 – http://www.youtube.com/watch?v=UuGqzViRhNw

Categories: 好歌 Tags: , ,
分頁: 上一頁 1 2