Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere, on-demand edition 1.0 Support Package 3 » SAP Sybase SQL Anywhere, on-demand edition 1.0 » Tenant databases » Connections to tenant databases

 

Connecting to a database in the cloud via an HTTP or HTTPS web service

Connect to a database that is currently running in the cloud by using an HTTP or HTTPS web service.

Prerequisites

To connect to a database in the cloud,supply at minimum a server address in the cloud, the name of the database, and a user ID and password for the database.

 Task
  1. Open a browser.

  2. Use a URL similar to the following to connect to a tenant database:

    http://cloud-host-address:port/tenant-database-name[(node-type)]
    /web-service-name[/url-path][http-parameters]

Results

The HTTP connection is automatically redirected to the cloud server running the specified tenant database.

Example

  • For example, suppose you have a cloud server on host cloudhost3 that uses the fixed HTTP port 80. You have a tenant database called tenant4 that is running on the cloud server cloudhost4#1. To execute the web service querywebservice on the tenant4 database, browse to the following URL:

    http://cloudhost3/tenant4/querywebservice
  • For example, suppose you have a cloud with three cloud hosts named cloudhost1, cloudhost2, and cloudhost3. The server on cloudhost3 uses the fixed HTTP port 80. You have a tenant database called mytenant that uses both mirroring and read-only scale-out. The primary database copy for the mytenant database runs on cloud server cloudhost2#1; the mirror database copy runs on the cloud server cloudhost4#1; and a scale-out database copy runs on cloud server cloudhost3#1.To execute the web service querywebservice on the mytenant primary database, browse to the following URL:

    http://cloudhost3/mytenant/querywebservice

    To execute the web service querywebservice on the mytenant mirror database, browse to the following URL:

    http://cloudhost3/mytenant(MIRROR)/querywebservice

    To execute the web service querywebservice on the mytenant scale-out database copy, browse to the following URL:

    http://cloudhost3/mytenant(COPY)/querywebservice

 See also