A single computer can run multiple database servers at the same time. Each database server can run multiple databases at the same time. The connection parameters required to connect to a database vary depending on whether multiple database servers are running on the same computer, whether multiple databases are running on the same database server, and whether the client application is running on the same computer as the database server.
The following list describes several common connection scenarios and the client connection parameters that are required in each case. By combining these connection parameters, you can correctly identify the database you want to connect to. In addition to those listed below, SQL Anywhere supports many connection parameters to handle less common connection scenarios.
Your computer may be running software that has an embedded SQL Anywhere server, in which case there could be multiple servers running without you realizing it. You should always specify the server name (ServerName=server-name).
Only one database server running only one database, running on the same computer as the client application The required connection parameters:
dbisql -c "UID=DBA;PWD=sql;ServerName=Demo12" |
Only one database server running only one database, running on a different computer than the client application, and the computer running the database server has a host named myhost
dbisql -c "UID=DBA;PWD=sql;ServerName=demo12;Host=myhost" |
Multiple database servers each running one database, running on the same computer as the client application
dbisql -c "UID=DBA;PWD=sql;ServerName=Demo12" |
Only one database server running multiple databases, running on the same computer as the client application
dbisql -c "UID=DBA;PWD=sql;ServerName=demo12;DBN=demo" |
You do not know if the database server or database are running and you want them started on the same computer as the client application so you can connect to it
dbisql -c "UID=DBA;PWD=sql;ServerName=Demo12;DBF=%SQLANYSAMP12%\demo.db" |
Discuss this page in DocCommentXchange.
|
Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1 |