Collection Contents Index Starting the database server Using ODBC data sources to connect pdf/chap3.pdf

First Guide to SQL Anywhere Studio
   PART 2. Getting Results with SQL Anywhere Studio
     CHAPTER 3. Running and Connecting to a Database Server       

Connecting to the sample database from Interactive SQL


Once the database server is running, you can connect to it from an application. Here we connect to it from Interactive SQL.

  To connect to the sample database from Interactive SQL:
  1. Ensure that the sample database is loaded on a running database, as described in. Starting the database server.

  2. Start Interactive SQL.

    The Interactive SQL logon window is displayed. For Windows 95 and Windows NT it looks as follows. For other operating systems the appearance is slightly different.

  3. Enter the user ID DBA and the password SQL. This is the default user ID and password for Adaptive Server Anywhere databases when they are created. The password does not appear when you type it. This prevents someone else from seeing your password. Click OK to connect to the sample database.

  4. After connecting to the database, the Interactive SQL window appears.

Notes 

Sending commands to the database 

Once you are connected to the database, you can send commands to it. For example, type the following line in the Command window.

SELECT * FROM employee;

Notes 

Click Execute or press F9. Information similar to the following will appear in the Data window.

emp_id

manager_id

emp_fname

emp_lname

102

501

Fran

Whitney

105

501

Matthew

Cobb

129

902

Philip

Chin

148

1293

Julie

Jordan

160

501

Robert

Breault

Interactive SQL retrieves the information by sending a request to your database server. The server, in turn, looks up the information in the employee table and returns it to Interactive SQL.

Other applications connect to the database in much the same way. To make the connection, they must submit both a user ID and a password.


Collection Contents Index Starting the database server Using ODBC data sources to connect pdf/chap3.pdf