Connecting to databases with Interactive SQL

Once a database server is running, you can connect to it from an application. In this example, we'll connect to the sample database, iqdemo.

StepsConnecting from the command line

Ensure that the demo database is loaded on a running server, as described in “Starting the database server”.

  1. Open a command prompt on your UNIX or Windows system.

  2. Start DBISQL by typing the following:

    dbisql -c "uid=DBA;pwd=SQL" -host localhost -port 1870
    

    The –c parameter specifies connection parameters. For a complete list of connection parameters, see Chapter 4, “Connection and Communication Parameters”in the System Administration Guide: Volume 1.

    NoteThe default user ID and password for the iqdemo database and other Sybase IQ databases are DBA and sql. If you have trouble connecting to a database, try changing the case of the user ID and password that you supply; the case sensitivity for that database may be set ON.

StepsConnecting from a Windows program group

  1. Start the server, as described in “Starting the database server”

    Click Start, point to programs, choose Sybase | Sybase IQ 15.1 | Interactive SQL Java.

  2. On the Identification tab, type DBA in the User box, and sql in the Password box.

    This is the default user ID and password for Sybase IQ databases. DBA is not case-sensitive; sql is case-sensitive, and must appear in all lowercase letters.

    On the Identification tab, you may also specify connection parameters stored in an ODBC data source to connect a client application. For more information about creating an ODBC data source and connecting using ODBC data sources, see Working with ODBC data sources in the System Administration Guide: Volume 1.

  3. On the Database tab, choose a server from the Server name box. If there are no servers listed, click Find to search for running servers.

    Server names appear in this format <hostname>_dbname. If the host name is localhost-xp and you are running the sample iqdemo database, the server name would be localhost-xp_iqdemo. If the server is remote, type host:port instead of the server name.

  4. Choose a database from the Database name box. I f there is only one database running, you can leave this field blank.

  5. What you do next depends on the server location:

  6. Click OK to open Interactive SQL.

Other applications connect to the database server in much the same way. To make the connection, they must submit both user ID and password. The Utility Guide gives more details about how to use DBISQL.