Connecting from a UNIX system

The following procedure shows how to connect to a running database from the command line on a UNIX system.

  1. Make sure that your PATH and other environment variables are correctly set, as described in Reference: Building Blocks, Tables, and Procedures > File Locations and Installation Settings.
  2. To ensure that the demo database is loaded on a running server, at the UNIX prompt, enter:
    ps -eaf | grep iqdemo
    To start the demo database, enter:
    cd $IQDIR15/demo
    start_iq @iqdemo.cfg iqdemo.db
  3. Start Interactive SQL:
    dbisql -c "uid=DBA;pwd=sql;eng=servername;links=tcpip"
    Replace servername with the same server name that was supplied in the start_iq command to start the server.
    Note:

    If you prefer the older utility Interactive SQL Classic to the Java-based version, enter dbisqlc instead of dbisql. Note that although dbisqlc is supported, dbisqlc does not contain all the features of dbisql.

    The –c parameter specifies connection parameters. You can also specify these parameters in a data source, as described later in this chapter.

    Note:

    The links=tcpip (or CommLinks=tcpip) parameter is only required if you use TCP/IP to connect to the database. If you use the shared memory port to connect to a local database you can omit the links parameter; however, it is always safer—and required on some platforms—to include complete network parameters.

    To connect to a database on a remote host, you must add the host name and port number. For example:

    dbisql -c "uid=DBA;pwd=sql;eng=SERV1_iqdemo;
    links=tcpip(host=SERV2;port=1234)"

    If you prefer, use this alternate form of the links clause, which has the same result:

    "links=tcpip(host=SERV2:1234)"