New Open Client and Open Server connection properties to enable you to specify a
default database at connection time.
- CS_PROP_INITIAL_DATABASE – used while connecting to
set the initial database. During the connection, after a successful login, a
parameterized use database command is sent to the server. The
connection succeeds, even if the use database command fails.
If error handling is performed inline, ct_diag() is used to
check for cached error messages indicating a success or a failure of the
use database command. ct_diag() is
called after the ct_connect() is completed. If a client
message callback handler is installed, the handler is invoked as a result of the
use database command. The handler checks the message
generated and decides how it wants to treat the failure of the use
database command. It can return CS_FAIL to
terminate the connection, or CS_SUCCEED to indicate the
failure can be ignored.
- CS_PROP_CURRENT_DATABASE – contains the last
reported database the connection was using, after
ct_connect() is complete. This property is set when the
client library sees an ENVCHANGE database token from the
server.
- CS_PROP_USE_LAST_DATABASE – a Boolean property that is
used with CS_HAFAILOVER to set the post-failover database to
the results of the most recent use database command. When
true, it causes CS_PROP_INITIAL_DATABASE to be updated to the
reported database name the server sends in an ENVCHANGE database token stream.
On failover, this updated value sets connection database.