Difference between revisions of "Lianja ODBC Driver on Linux"

From Lianjapedia
Jump to: navigation, search
Line 83: Line 83:
 
</code>
 
</code>
  
==Managing the Lianja SQL Server Service==
+
==Managing the Lianja Server Service==
For RedHat and other Linux variants that support the '''service''' command, the name of the Lianja SQL Server service is ''lianjasqld'' and has the following options:
+
For RedHat and other Linux variants that support the '''service''' command, the name of the Lianja Server service is ''lianjad'' and has the following options:
  
<pre>service lianjasqld start | stop | restart | status</pre>
+
<pre>service lianjad start | stop | restart | status</pre>
  
 
This command should be run as root / using sudo.
 
This command should be run as root / using sudo.
Line 93: Line 93:
 
!Option||Description
 
!Option||Description
 
|-
 
|-
|valign="top"|start||Start the Lianja SQL Server service
+
|valign="top"|start||Start the Lianja Server service
 
|-
 
|-
|valign="top"|stop||Stop the Lianja SQL Server service
+
|valign="top"|stop||Stop the Lianja Server service
 
|-
 
|-
|valign="top"|restart||Restart the Lianja SQL Server service
+
|valign="top"|restart||Restart the Lianja Server service
 
|-
 
|-
|valign="top"|status||Report the status of the Lianja SQL Server service
+
|valign="top"|status||Report the status of the Lianja Server service
 
|-
 
|-
 
|}
 
|}
Line 112: Line 112:
 
!Option||Description
 
!Option||Description
 
|-
 
|-
|valign="top"|start||Start the Lianja SQL Server service
+
|valign="top"|start||Start the Lianja Server service
 
|-
 
|-
|valign="top"|stop||Stop the Lianja SQL Server service
+
|valign="top"|stop||Stop the Lianja Server service
 
|-
 
|-
|valign="top"|restart||Restart the Lianja SQL Server service
+
|valign="top"|restart||Restart the Lianja Server service
 
|-
 
|-
|valign="top"|status||Report the status of the Lianja SQL Server service
+
|valign="top"|status||Report the status of the Lianja Server service
 
|-
 
|-
 
|}
 
|}

Revision as of 13:01, 27 January 2014

See Also

Lianja ODBC Driver, Lianja SQL Server Manager, 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

For RedHat and other Linux variants that support the service command, the name of the Lianja Server service is lianjad and has the following options:

service lianjad start | stop | restart | status

This command should be run as root / using sudo.

Option Description
start Start the Lianja Server service
stop Stop the Lianja Server service
restart Restart the Lianja Server service
status Report the status of the Lianja Server service

Alternatively, the lianja-admin command can be used:

lianja-admin start | stop | restart | status

This command should be run as root / using sudo.

Option Description
start Start the Lianja Server service
stop Stop the Lianja Server service
restart Restart the Lianja Server service
status Report the status of the Lianja Server service