Attribute

InitializationString (IS)

Purpose

One or multiple SQL commands to be executed by the driver after it has established the connection to the database and has performed all initialization for the connection. If the execution of a SQL command fails, the connection attempt also fails and the driver returns an error indicating which SQL command or commands failed.

Valid Values

string

where:

string
is one or multiple SQL commands.

Multiple commands must be separated by semicolons. In addition, if this option is specified in a connection URL, the entire value must be enclosed in parentheses when multiple commands are specified.

Example

When connecting to Cassandra for the first time, the driver queries the Cassandra metadata catalog and caches a view of the catalog in files stored on the client file system. The cached metadata is used in subsequent connections made by the user instead of re-fetching the metadata from Apache Cassandra. To force the driver to refresh the metadata information for every connection, use the Initialization String option to pass the REFRESH MAP command in the connection URL. For example:

DSN=Cassandra;UID={CassandraID};PWD=secret;InitializationString=(REFRESH MAP)

Notes

  • The purpose of this property is to execute commands that the application needs on every connection attempt. Primarily, these commands are used to alter the connect status or to get the latest view of the tables and columns defined in the Cassandra catalog. Therefore, commands specified through this property, such as SELECT, will not return result sets.

Default

None

GUI Tab

Advanced tab