These instructions explain how to create a connection between a Db2 database and IBM®
SPSS Statistics.
Before you begin
Before you can connect to your database, you must carry out the following steps:
-
Verify prerequisites, including installing driver
packages, configuring your local environment, and downloading SSL certificates (if needed)
-
Collect connect information, including database
details such as host name and port numbers, and connect credentials such as user ID and password
Procedure
- In SPSS Statistics,
click .
- In the Database Wizard, click Add ODBC data
source.
-
Use the ODBC Data Source Administrator window to add an ODBC data source
name (DSN) for the Db2 database:
-
On the User DSN tab, click Add.
-
On the Create New Data Source window, select the driver that is named
IBM DB2 ODBC DRIVER and click Finish.
Be sure that the driver that you select is not a driver with a similar name such as IBM
DB2® ODBC DRIVER - DB2COPY. If the driver does not appear in
the list, exit SPSS Statistics, then download and install the
driver. See Db2 driver package.
-
In the ODBC IBM Driver - Add window, enter a data source name (usually the
name of the database you are connecting to), and click Add.
-
From the CLI/ODBC Settings window, on the Data
Source tab, enter the user ID and password from the database details and connect credentials that you collected
beforehand.
-
On the Advanced Settings page, for each of the following parameters, click
Add to open the Add CLI Parameter window to begin the
step, and click OK to return to the Advanced Settings
page:
- Select the Database parameter, then click OK to
open the CLI/ODBC Settings window. In the Pending Value
field, enter the database name from the database details and connect credentials that you collected
beforehand.
- Select the Hostname parameter, then click OK to
open the CLI/ODBC Settings window. In the Pending Value
field, enter the host name from the database details and connect credentials that you collected
beforehand.
- Select the Port parameter, then click OK to open
the CLI/ODBC Settings window. In the Pending Value
field, enter the port number from the database details and connect credentials that you collected
beforehand.
- Select the Protocol parameter, then click OK to
open the CLI/ODBC Settings window. Select TCP/IP.
-
Click OK to return to the ODBC Data Source
Administrator window.
-
On the User DSN tab, select the data source name, then click
Configure.
-
On the CLI/ODBC Settings window, click Connect to
test the connection.
- If the connection is successful, click OK to return to the ODBC
Data Source Administrator window, and then click OK to exit the
window.
- If the connection is not successful, note and correct any errors before you test the connection
again.