This article describes the detailed steps for connecting to the DB2 database for your reference. Compared with SQL and ORACLE, DB2 database connection is more troublesome. The connection includes the following steps:
1. First, map the database on the database server to the client for ODBC reasons)
The ing command is as follows:
Db2cmd
Db2
// Map the remote node 192.168.80.207: 50001 to the local node node207
Catalog tcpip node node207 remote 192.168.80.207 server 50001
// Map the database zcldb to the local node207 Node
Catalog database zcldb at node node207
2. Added ODBC to connect to the local DB2 ing database.
3. The application connects to ODBC
Connection string:
<Add name = "DB2ConnectionString" connectionString = "driver = {IBM DB2 odbc driver}; DSN = localdbname; UID = user; DBALIAS = localdbname; MODE = SHARE; PWD = password; "providerName =" System. data. odbc "/>