DatabaseRoute 和 DatabaseRetrieve 节点通过使用存储在 Integration 节点注册表中的连接详细信息构建自己的 JDBC 连接,其中包含标准 DBMS JDBC 提供者设置。
如果您正使用 Oracle 数据库,请使用以下指示信息创建 JDBC 提供者条目。 您可以使用 mqsicreateconfigurableservice 命令(该命令在以下脚本中提供)创建名为 SIMPLERROUTEDB 的新 JDBC 提供者条目。此条目由样本所使用的数据库节点中的“数据源名称”属性字段引用。以下指示信息还可配置具有用户标识和密码的 JDBC 提供者条目以供 Integration 节点在访问数据库时使用。
为数据库创建 JDBC 提供者条目:
mqsistart IB9NODE
您必须将脚本中的以下占位符替换为适合您的环境的值。
mqsideleteconfigurableservice IB9NODE -c JDBCProviders -o SIMPLERROUTEDB mqsicreateconfigurableservice IB9NODE -c JDBCProviders -o SIMPLERROUTEDB -n connectionUrlFormat,connectionUrlFormatAttr1,description,jarsURL,portNumber, serverName,type4DatasourceClassName,type4DriverClassName -v "jdbc:oracle:thin:[user]/[password]@[serverName]:[portNumber]:[connectionUrlFormatAttr1], <SID>,Simplified Database Routing Sample Database,<JARS URL>,<PORT NUMBER>, <SERVER NAME>,oracle.jdbc.xa.client.OracleXADataSource,oracle.jdbc.OracleDriver"
simplifieddbrouting.bat
运行脚本时,它将执行以下任务:
BIP8984W: Configurable service object name 'JDBCProviders : SIMPLERROUTEDB' was not found. The user has tried to delete or modify a configurable service object name that does not exist. Check the names of the existing configurable services using the mqsireportproperties command. Then modify the external resource object name and reissue the command. BIP2087E: Broker IB9NODE was unable to process the internal configuration message. The entire internal configuration message failed to be processed successfully. The internal configuration message failed to be processed, use the messages following this message to determine the reasons for the failure. BIP8036E: Negative response received. This command sends an internal configuration message to the broker, the response received indicated that the internal configuration message was unsuccessful. Check that the WebSphere MQ transport is available. Check the system log for further information.请忽略此消息。显示此消息是因为脚本尝试先删除名为 SIMPLERROUTEDB 的现有 JDBCProvider 注册表条目,然后再重新创建该条目。如果之前未曾运行此脚本,那么将无法在注册表中找到该条目。
mqsireportproperties IB9NODE -o SIMPLERROUTEDB -c JDBCProviders -r
如果已成功更新,那么从该命令报告的属性输出将与以下示例匹配:
JDBCProviders
SIMPLERROUTEDB
connectionUrlFormat='jdbc:oracle:thin:[user]/[password]@[serverName]:[portNumber]:[connectionUrlFormatAttr1]'
connectionUrlFormatAttr1='orc1'
connectionUrlFormatAttr2=''
connectionUrlFormatAttr3=''
connectionUrlFormatAttr4=''
connectionUrlFormatAttr5=''
databaseName='default_Database_Name'
databaseType='default_Database_Type'
databaseVersion='default_Database_Version'
description='Simplified Database Routing Sample Database'
environmentParms='default_none'
jarsURL='C:\oracle\oraxx\jdbc\lib'
portNumber='1521'
securityIdentity='default_User@default_Server'
serverName='localhost'
type4DatasourceClassName='oracle.jdbc.xa.client.OracleXADataSource'
type4DriverClassName='oracle.jdbc.OracleDriver'
BIP8071I: Successful command completion.指定用户标识和密码以与 JDBC 提供者 SIMPLERROUTEDB 相关联:
使用 mqsisetdbparms 和 mqsichangeproperties 命令以指定 Integration 节点的用户标识和密码来使用 JDBC 提供者 SIMPLERROUTEDB。此用户标识必须是您创建数据库时所使用的同一用户标识。
mqsisetdbparms IB9NODE -n jdbc::mySecurityIdentity -u <user ID> -p <password>
mqsichangeproperties IB9NODE -c JDBCProviders -o SIMPLERROUTEDB -n securityIdentity -v mySecurityIdentity
有关更多信息,请参阅 IBM Integration Bus 文档中的启动到数据库的 JDBC 连接和 DatabaseRoute 节点的“使 JDBC 提供者服务对 DatabaseRoute 节点可用”部分。