Lianja ODBC Driver on Linux
See Also
Lianja ODBC Driver on Windows, Lianja ODBC Manager on Windows, Lianja Server Manager on Linux, Lianja Server Manager on Windows, SQL System Tables
unixODBC
The unixODBC ODBC Driver Manager is required and should be installed before the Lianja SQL Server to allow the Lianja installer to add the Lianja ODBC Driver and the sample LianjaDemo DSN to the Driver Manager's ini files.
The unixODBC isql utility can be used to access the LianjaDemo DSN and any new DSNs you create:
isql -v LianjaDemo
New DSNs should be added to the unixODBC odbc.ini file. The location of the system and current user's odbc.ini file can be obtained as follows:
odbcinst -j
The DSN format is as follows:
[<unique DSN>] Description = <informative text> Driver = Lianja Database = <URL>
Where the <URL> is in the following format:
ODBC:RECITAL:SERVERNAME=<node>;USERNAME=<user>;PASSWORD=<password>;DATABASE=<database>;
or
ODBC:RECITAL:SERVERNAME=<node>;USERNAME=<user>;PASSWORD=<password>;DIRECTORY=<directory>;
The following may also be included:
CLIENTLOGGING=TRUE;CLIENTLOGFILE=<filename>;
For example
[southwind] Driver = Lianja DATABASE = ODBC:RECITAL:SERVERNAME=192.168.1.3;USERNAME=user;PASSWORD=password;DATABASE=southwind; CLIENTLOGGING=TRUE;CLIENTLOGFILE=trace.txt; [dir_test] Driver = Lianja DATABASE = ODBC:RECITAL:SERVERNAME=192.168.1.3;USERNAME=user;PASSWORD=password;DIRECTORY=/opt/lianja/data/od1;
Notes
- As an alternative to manually editing the files, the same format can be used to create template files for installation by odbcinst:
$ odbcinst -i -s <-l|-h> -f template_file
Running 'odbcinst' with no parameters gives usage instructions.
- The <node> can be the hostname or IP address. A '?' can be used to signify the local host.
- Storing the user and password details in the DSN is optional and careful consideration should be given to security implications. A '?' can be used in place of the user and password for local host connections.
DSNless Connection
To connect to the Lianja ODBC Driver without creating a DSN, use the following string format:
DRIVER=Lianja;SERVERNAME=<IP or Hostname>;USERNAME=<server-user>;PASSWORD=<user-password>;DATABASE=<database>
For example:
lcDSNLess="DRIVER=Lianja;" ; + "SERVERNAME=192.168.123.123;USERNAME=myuser;PASSWORD=mypassword;DATABASE=southwind" lnConnHandle=SQLSTRINGCONNECT(lcDSNLess) if lnConnHandle > 0 sqlexec(lnConnHandle,"select * from shippers") list sqldisconnect(lnConnHandle) endif
Managing the Lianja Server Service
Please see Lianja Server Manager on Linux for information on managing the Lianja Server. The Lianja Server listens for requests for both the Lianja SQL Server and the Lianja Cloud Server.