CSV 文本文件的示例

CSV 文本文件包含有关所有数据库连接的信息。您可以创建并导入此文件,以添加定义的数据库连接。 也可以使用产品随附的样本 CSV 文本文件。此 CSV 样本文本文件位于安装目录的 samples 子目录中。

CSV 文本文件的参数

下表描述可在 CSV 文件中定义的参数。
表 1. CSV 文本文件的参数
参数 说明
name(必需)

唯一的数据库连接名称。

由于名称参数是数据库连接的标识,因此每个连接都必须具有唯一名称。
注: 导入期间,如果导入文件包含重复的 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 参数,那么在定义中指定的密码必须为加密格式。
locationDB2Z 必需) DB2 for z/OS® 系统的位置。
databaseAlias(可选) DB2 命令行处理器 (CLP) 的别名。此参数仅可用于数据服务器类型 DB2LUW 和 DB2Z。
INFORMIXSERVERNAMEINFORMIX_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;, ,        

反馈