Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
dev:connections:home [2011/01/20 18:59]
els
dev:connections:home [2012/10/26 14:51] (current)
Line 5: Line 5:
  
 ===== Connection Strings ===== ===== Connection Strings =====
 +
 +WARNING: Connections Strings were under development between the 5.0, 5.1 versions and the information in this guide may not properly reflect the operation of connection strings under 5.1 at this time.
  
 Omnidex uses connection strings to connect to Omnidex Environment Files. ​ A connection string is a universal syntax that describes the location, network information and options for connecting to the environment file.  Connection strings are used throughout the Omnidex product, including ODBC, JDBC, Omnidex Grids, and the Omnidex SQL Engine. Omnidex uses connection strings to connect to Omnidex Environment Files. ​ A connection string is a universal syntax that describes the location, network information and options for connecting to the environment file.  Connection strings are used throughout the Omnidex product, including ODBC, JDBC, Omnidex Grids, and the Omnidex SQL Engine.
Line 18: Line 20:
 ==== Discussion ==== ==== Discussion ====
  
 +=== Parameters ===
  
 == host == == host ==
Line 43: Line 46:
 The options to be used when connecting to the Omnidex Environment File.  The allowed options are documented as part of the SQL [[dev:​sql:​statements:​connect:​home|CONNECT]] statement. The options to be used when connecting to the Omnidex Environment File.  The allowed options are documented as part of the SQL [[dev:​sql:​statements:​connect:​home|CONNECT]] statement.
  
-==== Using Environment Variables and Shell Commands ​====+=== Using Environment Variables and Shell Commands ===
  
-Omnidex allows environment variables to replace any or all of the components of a connection string. ​ The syntax ​for referencing an environment variable on the remote host is {$VARIABLE},​ where VARIABLE is the name of the environment variable.  The syntax for referencing an environment variable ​on the local host is {$$VARIABLE}. ​ The entire connection string could be replaced with environment variables using the following syntax. ​ Note that any variable name can be used.+Omnidex ​supports environment variables and shell commands to be used in many places within the product. ​ Omnidex also allows environment variables to replace any or all of the components of a connection string. ​ The syntax ​used in connection strings is more unique that the [[appendix:​reference:​envvar:​home|general syntax]]. ​ This is because ​of the need to differentiate whether ​the environment variable ​resides ​on the client or the server.
  
-The following example shows environment ​variables on the remote host.  Note that that host, port and pool can only reference variables ​on the local host since that is required for communicating with the remote host: +The syntax for referencing an environment ​variable ​on the local host is {$VARIABLE}, where VARIABLE is the name of the environment variable. ​ The syntax for referencing ​an environment variable ​on the remote ​host is {$$VARIABLE}.  The entire connection string could be replaced with environment variables using the following ​syntax.  Note that any variable name can be used.
- +
-[ {$$HOST} : {$$PORT} : {$$POOL} ] {$FILENAME} [ {$NODE} ] &​{$OPTIONS} +
- +
-The following example shows environment variables on the local host: +
- +
-[ {$$HOST} : {$$PORT} : {$$POOL} ] {$$FILENAME} [ {$$NODE} ] &​{$$OPTIONS} +
- +
-Omnidex also allows shell commands to be used in place of environment variables. ​ Shell commands can be used to allow an external process to produce ​the value, rather than relying on an environment variable. ​ The syntax for referencing ​a shell command ​on the remote ​server ​is {$(command)}, where command is the shell command.  The syntax for referencing a shell command on the local server is {$$(command)}. +
- +
-The following ​example shows shell commands on the remote UNIX host from a local Windows client.  Note that that host, port and pool can only reference shell commands on the local host since that is required for communicating with the remote host: +
- +
-[ {$$(type host.txt)} : {$$(type host.txt)} : {$$(type pool.txt)} ] {$(cat filename.txt)} [ {$(cat node.txt)} ] &{$(cat options.txt)} +
- +
-The following example shows shell commands on the remote host: +
- +
-[ {$$(cat host.txt)} : {$$(cat host.txt)} : {$$(cat pool.txt)} ] {$(cat filename.txt)} [ {$(cat node.txt)} ] &{$(cat options.txt)}+
  
 +Omnidex also allows shell commands to be used in place of environment variables. ​ Shell commands can be used to allow an external process to produce the value, rather than relying on an environment variable. ​ The syntax for referencing a shell command on the local server is {$(command)},​ where command is the shell command. ​ The syntax for referencing a shell command on the remote server is {$$(command)}. ​ Note that if the shell command contains spaces or punctuation marks, it should be enclosed in quotation marks.
  
 +Whether using environment variables or shell commands, the host, port and pool parameters can only reference the local server. ​ This is required since the connect to the remote server cannot be made without this information from the local server.
  
 ==== Examples ==== ==== Examples ====
Line 71: Line 60:
 == Connection to local environment file == == Connection to local environment file ==
  
-This connection string connects to a environment file on the local machine. ​ Because of the absence of bracketed network information,​ this connection will not require Omnidex Network Services.  ​+This connection string connects to an environment file on the local machine. ​ Because of the absence of bracketed network information,​ this connection will not require Omnidex Network Services.  ​
  
   c:​\class\simple.xml   c:​\class\simple.xml
Line 97: Line 86:
  
   [server1:​7555]c:​\class\simple.xml&​read   [server1:​7555]c:​\class\simple.xml&​read
 +
 +== Connection to a remote environment with environment variables ==
 +
 +This connection string connects to an environment file using local environment variables for the host and port, and using a remote environment variable for the filename.
 +
 +  [{$HOST}:​{$PORT}]{$$ENVIRONMENT_FILENAME}
 +
 +== Connection to a remote environment with shell commands ==
 +
 +This connection string connects to an environment file using a local Windows shell command for the host and port, and using a remote UNIX shell command for the filename. ​ Note that quotation marks are required because the shell command contains spaces.
 +
 +  [{$(host.bat)}:​{$(port.bat)}]"​{$$(cat filename.txt)}"​
  
  
 
Back to top
dev/connections/home.1295549983.txt.gz · Last modified: 2012/10/26 14:47 (external edit)