I am trying to connect to an IBM Db2 Event Store cluster from a Java application that is already connecting to a Db2 instance. Can I have the same application connect to the Event Store instance using the same Jar ?
I've found my answer in this github repository containing samples for Db2 Event Store remote applications.
It seems pretty straight forward, like any regular connection to a Db2 instance, but in the case of Db2 Event Store Enterprise Edition, it is configured with SSL out of the box, so there are a few more parameters that are required for the connection to be successful. From that document, these are the steps that I extracted:
kubectl get sac -n dsx
Get the EXTERNAL-IP column value for the eventstore-tenant-engine-svc
service, and the port number is 18729 from the exported ports (PORT(S) column) that corresponds to the JDBC port.jdbc:db2://<Your Db2 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;
. ** Note that this is the JDBC connection URL. The database name EVENTDB is the default database that is created by Db2 Event Store at install time. // Establish connection with ssl and user credentials
conn =
DriverManager.getConnection(
"jdbc:db2://" + IP + ":18729/EVENTDB:" +
"sslConnection=true;" +
"sslTrustStoreLocation="+ KEYDB_PATH + ";" +
"sslKeyStoreLocation="+ KEYDB_PATH + ";" +
"sslKeyStorePassword="+ KEYDB_PASSWORD + ";" +
"sslTrustStorePassword="+ KEYDB_PASSWORD + ";" +
"securityMechanism=15;" +
"pluginName=IBMIAMAuth;",
USERNAME, PASSWORD);
An alternative to downloading the Keystore and its password is to just download the certificate, also through the REST API using the instructions documented in the IBM Knowledge Center for Db2 Event Store. This is the link to the documentation for REST
jdbc:db2://<Your Db2 Event Store Cluster VIP>:18729/EVENTDB:sslConnection=true;sslCertLocation=<path to certificate downloaded from cluster>;securityMechanism=15;pluginName=IBMIAMAuth;
. ** Note that this is the JDBC connection URL. The database name EVENTDB is the default database that is created by Db2 Event Store at install time. // Establish connection with ssl and user credentials
conn =
DriverManager.getConnection(
"jdbc:db2://" + IP + ":18729/EVENTDB:" +
"sslConnection=true;" +
"sslCertLocation="+ CERT_PATH + ";" +
"securityMechanism=15;" +
"pluginName=IBMIAMAuth;",
USERNAME, PASSWORD);
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.