When the configuration of the server and client is
complete, use the following steps to verify that you can access data from a
You will need to connect to a remote database to test the
connection. If you do not have a database on the server, create the
SAMPLE database on the server to test the connection. See "Creating the Sample Database" for more information.
connect to database_alias user userid using password
The database alias (database_alias) is an arbitrary local nickname for the remote database on the client. If you do not provide one, the default is the same as the database name (database_name). This is the name that you use when connecting to a database from a client.
The values for userid and password must be valid for the system on which they are authenticated. By default, authentication takes place on the SERVER. If the database manager is configured for CLIENT authentication, the userid and password must be valid on the client.
If the connection is successful, you will get a message showing the name of the database to which you have connected. You are now able to retrieve data from that database. For example, to retrieve a list of all the table names listed in the system catalog table, enter the following SQL command in the Command Center or command line processor:
"select tabname from syscat.tables"
When you are finished using the database connection, enter the connect
reset command to end the database connection.
You are ready to start using the DB2 client to communicate with a DB2
server. See Chapter 16. "Getting Started with DB2 Universal Database" for details.
[ DB2 List of Books | Search the DB2 Books ]