2010年5月18日 星期二

設定 Rational 軟體的語系

Rational語系設定依不同版本,有不同之設定方式:

For version 6.0.x:

  • Start IBM Rational Software Development Platform executable (rationalsdp.exe) with the -nl argument followed by the language en_US (for United States English) such as:
    rationalsdp.exe -nl en_US
  • Add the variable VMArgs=-Duser.language=en into the filerationalsdp.ini under the individual VMArgs section as shown below:

    ; Add other individual VMArgs with additional VMArgs keys i.e.
    ; VMArgs=arg1
    ; VMArgs=arg2

    VMArgs=-Duser.language=en

Both rationalsdp.exe and rationalsdp.ini are located by default in:
<IBM_INSTALL_DIR>\rational\SPD\6.0
(for example, C:\Program Files\IBM\Rational\SDP\6.0)

=========================================================================

For version 7.0.x:

  • Start IBM Rational Software Delivery Platform with the -nlargument followed by the language en_US (for United States English) such as:
    RSA
    "eclipse.exe" -nl en_US -product com.ibm.rational.rsa.product.ide

    RAD
    "eclipse.exe" -nl en_US -product com.ibm.rational.rad.product.ide
    RSM
    "eclipse.exe" -nl en_US -product com.ibm.rational.rsm.product.ide
    RSD
    "eclipse.exe" -nl en_US -product com.ibm.rational.rsd.product.ide
  • Add the variable VMArgs=-Duser.language=en into the fileeclipse.ini under the VMArgs section as shown below:
    ...
    -vmargs
    -Duser.language=en
    -Xquickstart
    ...

Both eclipse.exe and eclipse.ini are located by default in:
<IBM_INSTALL_DIR>\SPD70
(for example, C:\Program Files\IBM\SDP70)

=============================================================

For version 7.5.x:

  • Start IBM Rational Software Delivery Platform with the -nlargument followed by the language en_US (for United States English) such as:
RSA
"eclipse.exe" -nl en_US -product com.ibm.rational.rsa.product.ide

RAD
"eclipse.exe" -nl en_US -product com.ibm.rational.rad.product.ide
RSM
"eclipse.exe" -nl en_US -product com.ibm.rational.rsm.product.ide
RSA SE
"eclipse.exe" -nl en_US -product com.ibm.rational.rsastd.product.v75.ide
  • Add the variable VMArgs=-Duser.language=en into the fileeclipse.ini under the VMArgs section as shown below:
...
-vmargs
-Duser.language=en
-Xquickstart
...

Both eclipse.exe and eclipse.ini are located by default in:
<IBM_INSTALL_DIR>\SPD
(for example, C:\Program Files\IBM\SDP)
  • Add osgi.nl=en to the end of the config.ini file located under <IBM_INSTALL_DIR>\SPD\configuration

Identifying v.s. Non-Identifying relation --- Rational Data Architect

在建構 Logical or Physical Data Model時,Rational Data Architect提供了下列五種不同的選項來描述 Entity 之間的關係,以下描述這五種不同關係的差異性為何

  • Identifying Foreign Key Relationship
  • Non-Identifying Mandatory Foreign Key Relationship
  • Non-Identifying One-to-One Foreign Key Relationship
  • Non-Identifying Optional Foreign Key Relasionship
  • Many-to-Many Relationship

這裡先區辨Identifying 和 Non-Identifying的差異。 在一個Identifying的關係中,父Entity 中的Primary Key會被加到子Entity中成為Foreign Key,且此Foreign Key和子Entity的原本的Primary Key會組合成該子Entity的Composite Primary Key;相反地,Non-Identifying的關係中,父Entity的Primary Key只會單純地成為子Entity的Foreign Key,而子Entity還是使用自己原本的Primary Key,而不會與來自父Entity的Foreign Key結合為Composite Primary Key。見下圖

image

 

image

 

介紹完Identifying和Non-Identifying的差異後,接下來介紹Non-Identifying這一大類的關係。Non-Identifying又可再細分為Mandatory、One-to-One及Optional 等三種關係。依照建立關聯後,加到子Entity的Foreign Key是否允許空值,可分出(Mandatory + One-to-One) 與Optional的差異。Optional的關係中,建在子Entity的Foreign Key允許有空值;而Mandatory及One-to-One不允許空值。

再來,Mandatory與One-to-One Foreign Relationship的差異在於 Foreign Key的cardinality,即One-to-One的Foreign Key允許1對1的關係(Cardinality為 零 或 1);而Mandatory的Foreign Key則為1對多的關係(Cardinality為零或無限)

最後,Many-to-Many的關係則不會在子Entity中建立任何欄位 e.g. Foreign Key,只是單純地描述兩個Entity之間有多對多的關係。它的用處比較像是在Model high level的 Logical Data Model時使用,此時尚不討論到實作的細節。最後在實作時,可能是在父Entity及子Entity之間,新建一個Entity。而父Entity與子Entity分別與此新建Entity間,存在Identifying Foreign Relationship的關係

2010年5月2日 星期日

使用DB2 Sequence物件

在使用DB2時,若需要連續性地產生一連串數字做為ID,可以考慮使用DB2提供的 Sequence物件

產生Sequence物件

產生Sequence物件的方式很簡單,下面的例子會產生一個名稱ORG_SEQ的序列物件;數字會由1開始,每次增加1,不限制最大數字,且不重覆使用數字;另外會先cache 24個數字在記憶體中,以加快取得數字的效能

CREATE SEQUENCE ORG_SEQ
START WITH 1
INCREMENT BY 1
NO MAXVALUE
NO CYCLE
CACHE 24



使用Sequence物件



使用Sequence物件語法如下



SELECT NEXTVAL FOR ORG_SEQ FROM staff WHERE id=10


重設Sequence物件


若要將Sequence的值重新歸零,只需執行下列指令
ALTER SEQUENCE ORG_SEQ RESTART


刪除Sequence物件


DROP SEQUENCE ORG_SEQ


參考網址 :http://www.ibm.com/developerworks/data/library/techarticle/0205pilaka/0205pilaka2.html#section4