Progress
SQL-92
Guide and Reference


Connecting to a Database

Before you can connect SQL Explorer to a database server, the server must be configured to accept SQL connections and must be running. See the Progress Database Administration Guide and Reference for instructions on creating a database and starting a Progress database or database server.

Character Mode

Use the following syntax to start SQL Explorer in character mode and connect to a database:

SYNTAX
SQLEXP [-char] -r -url -S service_name | port_number
      -H host_name -db database_name 

OR:

SQLEXP [-char] -url jdbc:jdbcprogress:T:host_name:
     service_name | port_number:database_name 

EXAMPLE

After starting a database server for the “y2ksports” database on port 2000 of the same machine (the local host), you can start SQL Explorer in character mode and connect to the y2ksports database with the following command:

sqlexp -char -url jdbc:jdbcprogress:T:localhost:2000:y2ksports 

Notice that in this example no username or password is specified. The connect request is made using the current user login as the username. Once you are connected, the connection URL appears in the title of the Command Prompt window and the SQL Explorer prompt is ready to accept SQL-92 statements.

Windows

Follow these steps to connect to a database from the SQL Explorer window:

  1. Choose Connect from the SQL Explorer File menu. The Connect Database dialog box appears.
  2. In the Connect Database dialog box, choose “basic” or “url” tab to enter the information required by the database to which you want to connect:
    • To make a network connection to a database server running on the same machine leave the default host name “localhost” in the Host field, enter the service name or port number in the Service or Port field, and enter the physical filename of the database in the Database field.
    • To make a network connection to a database on a remote host enter the host name in the Host field, enter the service name or port number in the Service or Port field, and enter the physical filename of the database in the Database field.
  3. If password protection has been established for the database enter your User ID and Password, then click Connect. Otherwise, just click Connect.

Once you are connected the connection URL appears in the title of the SQL Explorer window.

You can change the SQL Explorer properties so the Connect Database dialog box prompts the user for the URL information. For more information, see "Modifying SQL Explorer Properties," later in this chapter.

To disconnect choose Disconnect from the File menu.

EXAMPLE

After starting a database server for the “y2ksports” database on port 2000 of the same machine (the local host), you can use SQL Explorer to connect to the y2ksports database. Use an authorized username, to connect to the database.

To connect to the database using the “basic tab”, enter the following information in the Connect Database dialog box, then click Connect.

The ’sysprogress’ username is the owner of the system tables, and is the initial DBA for the Progress SQL-92 sample databases. For information on authentication, see the Progress Database Administration Guide and Reference.

CAUTION: When a user connects to a database using the SQL Explorer, a share lock is automatically placed on the database’s schema. If multiple users connect to the same database using the SQL Explorer, and one user attempts to create a table or modify the database schema, the user will not be able to complete the modification because an exclusive lock on the schema could not be acquired.

Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095