Server Reference Guide : F. Contents of the 62demo Application Directories : Connect_example1 Application
 
Share this page          
Connect_example1 Application
This directory contains an example of a client/server application that shows various ways of passing user IDs and passwords to Ingres and Enterprise Access servers. It uses the local Loadnrun Standalone Net Client.
Purpose
The Connect_example1 application illustrates how to interactively connect to a database using the following connection flags that were first introduced in Ingres 2.5:
-local_system_user
-local_system_password
-remote_system_user
-remote_system_password
Audience
Specifically, this example is geared toward users who have used or who are attempting to use the IIPROMPT* environment variables.
IIPROMPT1, IIMPROMPTONCE, and IIPROMPTALL are undocumented environment variables that cause the Ingres Net server to prompt users to enter their password.
The two most prevalent issues reported about the use of the IIPROMPT* family of environment variables are:
There is no programmatic control over the password prompt.
There is no programmatic control over how to trap and display any errors that arise from the use of IIPROMPT*.
Description
The connect_example1 application illustrates a technique that you can use to prompt for a user ID and password, which will be used to connect to a database.
The following flags were introduced in the Ingres 2.5 release:
-remote_system_user userid
-remote_system_password password
-local_system_user userid
-local_system_password password

In Ingres 2.5, Ingres 2.6, Ingres r3, and Ingres 2006, the "‑remote_system_user" flag and the "-remote_system_password" flag overrode the user ID and password retrieved from a local vnode or global vnode.
In Ingres 2.5 these flags were effective only for remote connection requests. In Ingres 2.6, Ingres r3, and Ingres 2006, these flags overrode the user ID and password for local and remote connections.
The "-local_system_user" and "-local_system_password" connection flags were used to override the local connection user ID and password. If the user ID and password were valid, they allowed any private vnode information to be retrieved that was stored under the user ID specified. The user ID and password information was used to make a connection unless the "‑remote_system_user" and "-remote_system_password" connection flags were set.
Forcing the use of Loadnrun Client 6.2 runtime
The following directive forces the use of the Loadnrun 6.2 Client runtime if the application is launched by the Loadnrun60.bat or Loadnrun51.bat script:
ENVIRONMENT=PATH=%II_ECLIENT_APPDIR%bin;%II_LOADNRUN62_ROOT%\bin;%PATH%
Contents of the subdirectory
connect_example1.img
install4gl.txt
Contents of connect_example1\install4gl.txt
//
//  The following control statements must not start on line 1.
//
4GLVERSION =6,20,14001,0
IMAGEFILE  =connect_example1.img
CMDFLAGS   =-Tyes
//  The following environment variables are set by the run.bat that is generated
//  by Loadnrun when an application is downloaded from the server
//
//    Environment Variable       Value
//    --------------------       -----
//    II_ECLIENT_ROOT            %APPDATA%\Actian\eclientcache\[HOSTSYSTEM]\[HOSTSUFFIX]\
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN51_ROOT%\  (if launched using LOADNRUN51.bat)
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN60_ROOT%\  (if launched using LOADNRUN60.bat)
//    LOADNRUN_CLIENT_ROOT       %II_LOADNRUN62_ROOT%\  (if launched using LOADNRUN62.bat)
//    II_ECLIENT_RUNMODE         2
//    II_ECLIENT_URL             [HOSTSYSTEMURL]
//    II_ECLIENT_VERSION
//    II_ECLIENT_4GLVERSION      [INSTALL4GLVERSION]
//    II_ECLIENT_SUFFIX          [HOSTSUFFIX]
//    II_ECLIENT_APPDIR          %II_ECLIENT_ROOT%[APPNAME]
//    II_ECLIENT_LIBDIR          %II_ECLIENT_ROOT%lib
//    II_W4GLAPPS_SYS            %II_ECLIENT_ROOT%lib
//    II_W4GLAPPS_DIR            %II_ECLIENT_ROOT%[APPNAME]
//    II_LOG                     %II_ECLIENT_ROOT%[APPNAME]
//    II_ECLIENT_SYSTEM          %windir%\syswow64     (on 64-bit systems)
//    II_ECLIENT_SYSTEM          %windir%\system32     (on 32-bit systems)
//    PATH                       %II_ECLIENT_ROOT%qt;%LOADNRUN_CLIENT_ROOT%bin;%PATH%
//    II_LOADNRUN                TRUE
//
//  where the following are defined
//
//    String Name                String Value Description
//    -----------                ------------------------
//    [HOSTSYSTEMURL]            This is the URL that is passed when Loadnrun is invoked on
//                               the Client
//    [HOSTSYSTEM]               This is the system name that is hosting the [HOSTSYSTEMURL]
//    [HOSTSUFFIX]               This is the suffix that is passed when Loadnrun is invoked
//                               on the client
//    [INSTALL4GLVERSION]        This is the value of the 4GLVERSION directive located in
//                               the install4gl.txt
//    [APPNAME]                  This is the application name passed when Loadnrun is invoked
//                               on the Client
//
//  An example of the command that will be invoked is as follows
//
//    loadnrun62.bat [APPNAME] [HOSTSYSTEMURL] [HOSTSUFFIX]
//
//  The following ENVIRONMENT directives will be used to append SET statements in
//  the run.bat that will be generated by Loadnrun. These can override any environment
//  variables generated in run.bat prior to the launch of the application.
//
//  Force the use of the Loadnrun 6.2 client runtime for rrun.bat
//
ENVIRONMENT=PATH=%II_ECLIENT_APPDIR%bin;%II_LOADNRUN62_ROOT%\bin;%PATH%
//
//  Environment for Application
//
ENVIRONMENT=II_SYSTEM=%II_LOADNRUN62_ROOT%
ENVIRONMENT=PATH=%II_SYSTEM%\ingres\bin;%II_SYSTEM%\ingres\utility;%PATH%
ENVIRONMENT=OR_CONFIG=%II_ECLIENT_APPDIR%