Setting the Default Database Driver

 

With the introduction of the multi-database connection in Lycia 3 the default database driver for runtime and compilation takes effect only if there is no corresponding driver specification in the database configuration file for the used database name.

 

To Compile Programs using LyciaStudio

 

To set the database driver, start LyciaStudio and go to Window -> Preferences -> 4GL -> Database. From here, the developer can choose between a number of databases without the need to recompile after every change. This dialog window modifies the env.properties file which stores the environment variables used during Studio compilation. The LYCIA_DB_DRIVER variable acquires the following values depending on the option selected:

 

To Run Applications using AppServer

 

For the applications executed directly via the application server (i.e. for the applications run in GUI mode), the setting will be taken from the inet.env file associated with that particular listener.

 

To set the database driver you should open the inet.env file and modify the LYCIA_DB_DRIVER variable. This variable should have one of the following values:

 

To open the corresponding inet.env file follow the instructions below.

 

Step 1

Go to Window -> Preferences -> 4GL -> Run/Debug -> GUI Servers preferences page

 

Step 2

Select the GUI required server from the list

 

Step 3

Press the Edit Environment button

 

Step 4

inet.env will be opened in the editor area of LyciaStudio

 

Step 5

Edit the LYCIA_DB_DRIVER or add it, if it is absent:

 

LYCIA_DB_DRIVER=sserver

 

Step 6

Save the file and close it

 

 

For Command Line Tools

 

If you compile and run your programs using the command line environment, you must set one of the following values to the LYCIA_DB_DRIVER environment variable to specify which database you want to connect to:

 

To set this variable on Windows you can edit the environ.bat file located in $LYCIA_DIR\bin directory. In this case the specified database driver will be loaded each time Lycia Command Line Environment tool is launched. You can also set the value for this variable using the Lycia Command Line Environment, however, it will not be saved and used for another instance of the Lycia Command Line Environment. Use the "set" command to set a variable:

 

set LYCIA_DB_DRIVER=db2

 

On UNIX/Linux you should run the following command within a terminal/shell session or window from the Querix directory:

 

. environ

["dot" "space" "environ"]

 

Here you can change the LYCIA_DB_DRIVER variable.

The database driver may also be set by appending the –DB flag to an application on the command line, this overrides the variables in the environment settings.