solidDB Help : Programming : solidDB ODBC API : Connecting to a data source : Using logical data source names
  
Using logical data source names
If the data source name is not a valid solidDB connect string, the driver assumes it is a logical data source name.
The logical data source name can be mapped to a data source as a logical name and connect string (network name) pair in the following ways:
Use the [Data Sources] section in the client-side solid.ini file, see Data sources section.
For example, to map a logical name My_application to a database that you want to connect using TCP/IP, include the following lines in the solid.ini file:
[Data Sources]
My_application = tcp irix 1313; Sample data source
When an application calls the data source "My_application", the solidDB client maps this to a call to "tcp irix 1313".
In Windows environments, use the registry settings (ODBC Driver Manager).
You can use the Control Panel > Administrative Tools > Data Sources (ODBC) dialog or the Registry Editor (regedit) to add mappings.
For details, see Configuring the solidDB ODBC data source for Windows.
Note The solidDB data management tools use the solidDB ODBC API. If you have defined an ODBC data source, you can use the same logical name source name when you connect to solidDB by using the solidDB tools.
For example, if you have created a data source named "solid_1" with ServerName "tcp 2525", you can connect to the solidDB server with solidDB SQL Editor (solsql) by using the following command:
solsql solid_1
When you connect to the solidDB server, if the network name is not a valid connect string, the solidDB tools and clients assume it is a logical data source name. To find a mapping between the logical data source name and a valid connect string, the solidDB tools and clients check the client-side solid.ini file.
In Windows environments, if the solid.ini file is not found or the logical data source name is not defined in the [Data Sources] section, the following registry paths are checked (in order) for data source settings:
1 HKEY_CURRENT_USER\software\odbc\odbc.ini\DSN
2 HKEY_LOCAL_MACHINE\software\odbc\odbc.ini\DSN
The check for the logical data source mappings might impact performance:
If the file system is particularly slow, for example, because the working directory is mapped to a network drive, checking the existence of the solid.ini file can have a measurable performance impact.
In Windows environments, all logical data source mappings in the ODBC registry are checked. The time consumed for this operation is proportional to the amount of defined data sources.
With only few (1 to 5) data sources, the connection time will be approximately 5 ms.
With 1000 data sources, the connection time will be approximately 200 ms.
However, if the solid.ini file contains the logical data source name mapping, the tools and clients do not try to access the ODBC registry for the mapping.
Go up to
Connecting to a data source