Using Environment Variables

From InterBase
Jump to: navigation, search

Go Up to Programming with the InterBase API


InterBase client applications can use four environment variables to establish program parameters. These variables must be set so that they are available to the application when it is running. For example, setting these variables within a DOS window after Microsoft Windows has been started does not affect any Windows programs, but does affect DOS applications in that window.

The following table summarizes these variables and their uses:

Environment Variables Used by InterBase
Variable Purpose Example

ISC_USER

Specifies a user name for the PC client application.

SET ISC_USER = HERMES

ISC_PASSWORD

Specifies a case-sensitive ­password for the PC client ­application.

SET ISC_PASSWORD = Ichneumon

INTERBASE

If one installsInterBase to a non-default directory, setting the INTERBASE environment variable helps the client application contact the correct server instance running from the same INTERBASE location.

On Windows set the following in your system environment: INTERBASE=C:\Embarcadero\InterBase.

On UNIX set the following in your session environment. Default is either /usr/interbase/ or /opt/interbase/ depending on the UNIX system being used.

INTERBASE=/mydir/interbase

IB_PROTOCOL

Can be set to the name of the InterBase instance that you want to communicate with by default.

If this environment variable is not set, the client applications are expected to provide the instance name of the server to connect to in the database URL syntax.
For example:
connect 'localhost/my_instance:c:\interbase\examples\employee.gdb';

The IB_PROTOCOL is also used when connecting to remote servers. In this case, the instance name mentioned needs to have a TCP socket port number specified in the services file so the remote TCP port number can be connected.

If IB_PROTOCOL is set in the environment as such:

IB_PROTOCOL=my_instance

The ISC_USER and ISC_PASSWORD environment variables are used together to establish a valid user name and password combination to pass to the remote InterBase database server.

Important: Do not use the ISC_PASSWORD environment variable when security is a concern. Anyone with access to a client where an ISC_PASSWORD environment variable is defined in a file such as autoexec.bat can easily view the password.

Topics