Difference between revisions of "ODBC: Data Source Configuration"
From Recital Documentation Wiki
Yvonnemilne (Talk | contribs) (→Linux) |
Yvonnemilne (Talk | contribs) (→Linux) |
||
Line 54: | Line 54: | ||
DATABASE = ODBC:RECITAL:SERVERNAME=?;USERNAME=?;PASSWORD=?;DATABASE=odbc_test; | DATABASE = ODBC:RECITAL:SERVERNAME=?;USERNAME=?;PASSWORD=?;DATABASE=odbc_test; | ||
</pre> | </pre> | ||
− | |||
− | |||
Additional datasources can be added by editing the 'odbc.ini' text file directly, using the following format: | Additional datasources can be added by editing the 'odbc.ini' text file directly, using the following format: | ||
Line 97: | Line 95: | ||
</pre> | </pre> | ||
− | + | Notes | |
* The <node> can be the hostname or IP address. A '?' can be used to signify the local host. | * The <node> can be the hostname or IP address. A '?' can be used to signify the local host. |
Revision as of 14:37, 22 June 2010
Note: CLIENTLOGGING=TRUE;CLIENTLOGFILE=trace.txt;
Windows
Linux
To determine the location of the configuration files:
# odbcinst -j
Will return output similar to the following:
unixODBC 2.2.11 DRIVERS............: /etc/odbcinst.ini SYSTEM DATA SOURCES: /etc/odbc.ini USER DATA SOURCES..: /root/.odbc.ini
The Recital Driver information can be seen in the 'odbcinst.ini' file:
[Recital] Description = Recital ODBC Driver Driver = /opt/recital/drivers/libodbc_recital.so Setup = /opt/recital/drivers/libodbc_recital.so FileUsage = 1 UsageCount = 1
The Recital installer also adds the following DSN to the system 'odbc.ini' file:
[Recital ODBC test] Driver = Recital DATABASE = ODBC:RECITAL:SERVERNAME=?;USERNAME=?;PASSWORD=?;DATABASE=odbc_test;
Additional datasources can be added by editing the 'odbc.ini' text file directly, using the following format:
[<unique DSN>] Description = <informative text> Driver = Recital 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:
Trace = <Yes | No> TraceFile = <filename>
For example
[southwind] Driver = Recital DATABASE = ODBC:RECITAL:SERVERNAME=192.168.1.3;USERNAME=user;PASSWORD=password;DATABASE=southwind; [dir_test] Driver = Recital DATABASE = ODBC:RECITAL:SERVERNAME=192.168.1.3;USERNAME=user;PASSWORD=password;DIRECTORY=/opt/recital/data/od1;
Notes
- 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 where the environment variable DB_LOCAL_LOGIN is set to true in the recital.conf file.
- The DB_TMPDIR environment variable must be set to a valid writeable directory on the server.
- To test that the ODBC Driver is successfully installed and configured, use the dbodbc test program in <recital>/examples/odbc:
# make # ./dbodbc