When the configuration of the client is complete, use the
following steps to verify that you can access data from a remote
database:
![]() |
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. Refer to the Quick Beginnings manual 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" (for UNIX-based platforms) select tabname from syscat.tables (for other platforms)
When you are finished using the database connection, issue the connect reset command to end the database connection.