Create a Connectable (connectableCreate)

The connectableCreate command creates a connectable object in the model, defining connection attribute settings.

ttGridAdmin connectableCreate -dbdef name
                               [-cs [-only hostname[.instancename]]]
                               filepath

Options

The connectableCreate command has the options:

Option Description

-dbdef name

The name of the database definition object that the connectable references (which is the name of the database to connect to).

-cs

Specifies that the connectable will be for client/server access to the database. If this is not specified, the connectable will be for direct mode access.

-only hostname[.instancename]

For client/server connections, optionally specifies that applications connecting through this connectable should connect to the indicated instance. By default, all data instances in the grid are available and connections are distributed among them.

You need to specify the instance name only if there is more than one instance on the host. (See Grid Objects and Object Naming.)

You can specify multiple -only options, in which case client/server applications can connect to any instance listed in the -only settings.

filepath

Path and name of the connectable file, which contains the connection attribute settings for the connectable. The file name must be of the form connname.connect, where connname defines the name of the connectable.

Also see the example below.

Examples

The example creates a client/server connectable using this connectable file, database1client.connect:

ConnectionCharacterSet=AL32UTF8
UID=ttclient

Create the connectable:

% ttGridAdmin connectableCreate -dbdef database1 -cs 
/sw/tten/grid/conndefs/database1client.connect
Connectable database1client created.

Notes

  • The connectable file must be in odbc.ini format, as shown in the example, with attribute=value on each line. A DSN name, in [name] format such as [database1client] here, is optional. If provided, it must match the connectable name determined by the connectable file name.

  • The default value is used for any connection attribute not set in the connectable.

  • When you apply the model after creating a connectable, new versions of all necessary configuration files are written to each data instance. This makes the connectable available for use. (Never edit configuration files manually. They are overwritten each time the model is applied.)

  • You cannot set data store (creation time) attributes or first connection attributes in the connectable file. Those must be set in the database definition file for the dbdefCreate or dbdefModify command.

  • Any settings for TTC_SERVER, TTC_SERVER_DSN, or TCP_PORT are ignored. Appropriate values for the grid topology are automatically used.

  • The connectable that is defined is usable through all APIs supported by TimesTen.