简体   繁体   中英

DB2 JDBC connection url with instance name

Current JDBC URL using looks like jdbc:db2://server:446/DBname

Want to connect to a different instance by providing the instance name. How should be the connection string for this?

In jdbc you do not connect to an instance, instead you connect to a database. It is possible to ATTACH to a DB2-instance but normally you don't want to do that unless you are a DBA. To specify a different DB2-instance, mention its hostname(or IP-address, or Virtual-IP-address) and its port-number. If a hostname runs multiple DB2-instances, each DB2-instance will have a unique port-number on that hostname.

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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM