CSV 文字檔的範例

CSV 文字檔包含所有資料庫連線的相關資訊。您可以先建立再匯入此檔案,以新增您已定義的資料庫連線。 您也可以使用產品隨附的範例 CSV 文字檔。 此 CSV 範例文字檔位於安裝目錄的 samples 子目錄中。

CSV 文字檔的參數

下表說明您可以在 CSV 檔中定義的參數。
表 1. CSV 文字檔的參數
參數 說明
name(必要)

唯一的資料庫連線名稱。

name 參數是資料庫連線的 ID,所以每一個連線都必須具有唯一名稱。
註: 匯入期間,如果匯入檔案包含重複 name,則匯入精靈會提示您以新資料更新連線內容, 或保存現有的連線而不修改。
dataServerType(必要) 資料庫伺服器類型。允許下列值:
  • DB2LUW
  • DB2Z
  • INFORMIX
  • INFORMIX_JDBC
小心: 部分產品支援有限的資料庫伺服器集。在匯入資料來源連線之前, 請確定您的產品支援併入的 dataServerType 項目。
db2instance(選用) DB2® 實例名稱。
databaseName(必要) 此資料庫連線的資料庫名稱。
host(必要) 資料庫所在之主機的 IP 位址或 IP 名稱。若要擷取主機名稱,請在伺服器上執行 TCP/IP hostname 指令。若要擷取主機 IP 位址,請在伺服器上執行 ping host_name 指令。
port(必要) 配置資料庫所在的埠號。
user(選用) 資料庫使用者名稱。
password/password.decrypted(選用) 資料庫使用者的密碼。如果您使用 password 參數,則在定義中指定的密碼必須具有加密格式。
location(若為 DB2Z,則為必要) z/OS® 系統的 DB2 位置。
databaseAlias(選用) DB2 指令行處理器 (CLP) 的別名。此參數只能用於資料伺服器類型 DB2LUW 及 DB2Z。
INFORMIXSERVERNAME(若為 INFORMIX_JDBC,則為必要,若為 INFORMIX,則為選用) Informix® 資料庫伺服器的名稱。
xtraProps(選用)

其他內容,例如 JDBC 驅動程式文件中針對資料庫伺服器類型定義的連線內容。

範例:traceLevel=32

URL(請參閱說明) 資料庫伺服器的 JDBC URL。如果依預設不支援資料伺服器類型,則 URL 為必要參數。
註: 如果未輸入此參數的值,則會建立連線的預設 URL。
comment(選用) 資料庫連線的敘述性註解。

範例 CSV 文字檔

您可以在安裝目錄的 samples 子目錄中看到 CSV 文字檔的範例。 範例檔具有下列內容:
#=========================================================================#
#  Licensed Materials - Property of IBM                                   #
#  (c) Copyright IBM Corp. 2010, 2011 All Rights Reserved.                #
#  US Government Users Restricted Rights - Use, duplication or            #
#  disclosure restricted by GSA ADP Schedule Contract with                #
#  IBM Corp.                                                              #
#=========================================================================================================================================================================================
# Field                        ::  Description
# name                         ::  Required. The unique identifier for the database connection.
# dataServerType               ::  Required. The database type. The following databases are supported by default: DB2LUW, DB2Z.
# db2instance                  ::  Optional. The DB2 instance name.
# databaseName                 ::  Required. The database name.
# host                         ::  Required. The IP address or IP name of the host where the database exists.
# port                         ::  Required. The port number where the database is configured.
# user                         ::  Required. The ID of a user that has access privileges on the database.
# password/password.decrypted  ::  Optional. The password of the user ID. If you use the 'password' option, the value of this field must be the encrypted password.
# location                     ::  Optional. The location of DB2Z. This column is only required when the dataServerType is DB2Z.
# databaseAlias                ::  Optional. The alias of the DB2 CLP. This column is only used for DB2LUW and DB2Z.
# INFORMIXSERVERNAME           ::  Required if dataServerType is INFORMIX_JDBC.
# xtraProps                    ::  Optional. Additional properties such as connection properties as defined in the JDBC driver documentation for the database server type. Separate multiple properties with a semicolon.
# URL                          ::  Optional. The JDBC URL. This field is required if the data server type is not those supported by default.
# comment                      ::  Optional. A descriptive note for this this connection.
# securityMechanism            ::  Optional. This column is reserved/used for connection export only. Users should not modify this column.
# kerberosServerPrincipal      ::  Optional. This column is reserved/used for connection export only. Users should not modify this column.
#=========================================================================================================================================================================================
name,   dataServerType, databaseName, db2instance, host,            port,  user,   password, databaseAlias, location, INFORMIXSERVERNAME, xtraProps, URL,                                                                                                        comment,
#-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SAMPLEDB, DB2LUW,         SAMPLE_DATA,     ,            sample.ibm.com, 50002, inst95, ,         ,              ,         ,                   ,          jdbc:db2://sample.ibm.com:50002/SAMPLE_DATA:retrieveMessagesFromServerOnGetMessage=true;securityMechanism=3;, ,        

讀者意見