DB2 Uses command lines to connect to a remote database (+ uses coolsql to connect to DB2)

Source: Internet
Author: User
Tags db2 client
Document directory
  • The first half of this article: connecting to a remote DB2 database using command lines
  • The second part of this article: Use coolsql to connect to the DB2 database configuration Diagram
The first half of this article: connecting to a remote DB2 database using command lines. The second half of this article: connecting to a DB2 database using coolsql

DB2 client tool: DB2 runtime client v9.1 (25 MB)

Operating System: Windows 7 64bit

Before connecting to the remote DB2 service on the DB2 client, you must set the server communication protocol correctly. DB2 supports TCP/IP, NETBIOS, and npipe protocols.

The basic steps for connecting to the remote DB2 database service are as follows:
1. Catalog remote DB2 nodes on the client.
2. cataloguing the remote database on the client.

1. Step 1
First, catalog the remote nodes on the client. Here, you need to confirm the basic commands such as the name, IP address, and port number of the remote host on the client:
1. Catalog TCPIP // cataloguing a TCP/IP Node
Node local_node_name // the alias of the remote host on the client
Remote hostname | IP // Remote Host IP Address
Server SERVICE_NAME | posr_number // service name/port number

2. Terminate // refresh the directory Cache

3. List node directory // view the client directory node

4. uncatalog node node_name // Delete the node node_name

Step 2
Then, cataloguing the database of the compiled destination node, here, you need to confirm the name of the remotely connected database, the alias of the database on the local machine, the alias of the remote host on the client (that is, the node name) set in step 1, and set the authentication method. The command is as follows:

1. Catalog Database remote_db_name // remote database name
As local_db_name // local database alias
At node local_node_name // local database node alias (configured in step 1)

2. Terminate // refresh the directory Cache

3. List dB directory // view the local database directory

4. uncatalog dB db_name // Delete the database catalog db_name

Step 3
Connect to the remote database by using the local database alias set in step 2. The command is as follows:

Connect to local_db_name // connect to a remote database using the local database alias
User userid // user ID
Using password // logon Password

After the connection is successful, you can use tools such as coolsql to connect to the DB2 database. Because the remote DB2 database has been catalogued locally, you can use the local database catalog name to directly access the remote database.

 

======================================= ====================

Use coolsql to access the DB2 database

Install coolsql_windows_0_9_5_rc2.exe (the latest version is)

Coolsql:
Http://coolsql.sourceforge.net/index.html

Db2java.zip:
Http://download.csdn.net/detail/yhc2113/4464797

After installation, configure the DB2 connection

The main configuration is as follows:

1. Create a New bookmarks.

2. Add the JDBC jar driver package of the database you want to connect.

3. Configure the linked account.

4. Select bookmarks to connect.

 

Add external driver

 

Click Finish. After obtaining the name, click Finish.

 

OK. After coolsql is configured, you can access the DB2 database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.