是否可以从 MATLAB 连接到 IBM Db2 Event Store 实例?
IBM Db2 Event Store 2.0 supports the standard Db2 JDBC driver as it is integrated with the IBM Common SQL engine. Then to connect to MATLAB using the Database Explorer I just used the standard Db2 JDBC connection using the Db2 JDBC driver:
/<path where the JDBC jar was placed>/db2jcc4.jar
EventStoreJDBC
OTHER
as the vendorcom.ibm.db2.jcc.DB2Driver
jdbc:db2://<Your Event Store Cluster VIP>:18729/EVENTDB:sslConnection=true;sslTrustStoreLocation=<path to clientkeystore downloaded from cluster>;sslKeyStoreLocation=<path to clientkeystore downloaded from cluster>;sslKeyStorePassword=<password for clientkeystore retrieved from cluster>;sslTrustStorePassword=<password for clientkeystore retrieved from cluster>;securityMechanism=15;pluginName=IBMIAMAuth;
admin
and password
)Note these same instructions can be found in the IoT sample use case github repository for IBM Db2 Event Store
How do I do the same using the database object ?
This is what I tried
conn = database('db2inst1','admin','password','com.ibm.db2.jcc.DB2Driver','jdbc:db2://<Your Event Store Cluster VIP>:18729/EVENTDB:sslConnection=true;sslTrustStoreLocation=<path to clientkeystore downloaded from cluster>;sslKeyStoreLocation=<path to clientkeystore downloaded from cluster>;sslKeyStorePassword=<password for clientkeystore retrieved from cluster>;sslTrustStorePassword=<password for clientkeystore retrieved from cluster>;securityMechanism=15;pluginName=IBMIAMAuth;');
This is what I see
>> conn = database('db2inst1','admin','password','com.ibm.db2.jcc.DB2Driver','jdbc:db2://9.30.192.111:18729/EVENTDB:sslConnection=true;sslTrustStoreLocation=/Users/cmgarcia/Documents/MATLAB/eventstore/clientkeystore;sslKeyStoreLocation=/Users/cmgarcia/Documents/MATLAB/eventstore/clientkeystore;sslKeyStorePassword=Cc2cZ8TxdhWf;sslTrustStorePassword=Cc2cZ8TxdhWf;securityMechanism=15;pluginName=IBMIAMAuth;')
conn =
connection with properties:
DataSource: 'db2inst1'
UserName: 'admin'
Driver: 'com.ibm.db2.jcc.DB2Driver'
URL: 'jdbc:db2://9.30.192.111:1 ...'
Message: ''
Type: 'JDBC Connection Object'
Database Properties:
AutoCommit: 'on'
ReadOnly: 'off'
LoginTimeout: 0
MaxDatabaseConnections: 0
Catalog and Schema Information:
DefaultCatalog: ''
Catalogs: {''}
Schemas: {'ADMIN', 'NULLID', 'NULLIDR1' ... and 12 more}
Database and Driver Information:
DatabaseProductName: 'DB2/LINUXX8664'
DatabaseProductVersion: 'SQL110190'
DriverName: 'IBM Data Server Driver fo ...'
DriverVersion: '4.26.14'
>>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.