在MB中为访问Oracle配置JDBC
1/ 启动代理,确保代理上有执行组:
mqsistart BROKER
2/ 运行配置脚本:
mqsideleteconfigurableservice BROKER -c JDBCProviders -o TTT
mqsicreateconfigurableservice BROKER -c JDBCProviders -o TTT -n connectionUrlFormat,connectionUrlFormatAttr1,description,jarsURL,portNumber,serverName,type4DatasourceClassName,type4DriverClassName -v "jdbc:oracle:thin:XXX/XXX@IP:1521:SID,SID,Simplified Database Routing Sample Database,D:/oracle/product/10.2.0/db_1/jdbc/lib,1521,192.168.1.122,oracle.jdbc.xa.client.OracleXADataSource,oracle.jdbc.OracleDriver"
其中 TTT 是数据源名称;
3/ 检查配置是否成功:
mqsireportproperties BROKER -o TTT -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.
4/ 为刚配置的JDBC指定用户名和密码:
mqsisetdbparms BROKER -n jdbc::mySecurityIdentity -u XXX -p XXX
mqsichangeproperties BROKER -c TTT -o SID -n securityIdentity -v mySecurityIdentity
参阅MB7.0自带帮助:Creating a JDBC provider entry for an Oracle database