Class IDatastoreBaseCLI

IDatastoreBaseCLI is a base class that represents and manages datastore connections and transactions.


Hierarchy

Inherits from:

IBase
 |
 +----IVBase
       |
       +----INotifier
             |
             +----IStandardNotifier
                   |
                   +----IDatastoreBase
                         |
                         +----IDatastoreBaseCLI
IDABase
 |
 +----IDatastoreBaseCLI

Inherited by:

IDatastoreBaseCLI
 |
 +----IDatastoreDB2
 |
 +----IDatastoreODBC

Public Functions by Category

Destructor

~IDatastoreBaseCLI

public:
virtual ~IDatastoreBaseCLI();
Supported Platforms
Windows OS/2 AIX
Y Y Y

Connection Settings

connect

public:
virtual IDatastoreBaseCLI& connect( const char* datastoreName = 0 );
virtual IDatastoreBaseCLI& connect( const char* aUserName,
                                    const char* aAuthentication );
virtual IDatastoreBaseCLI& connect( const char* datastoreName, 
                                    const char* userName,
                                    const char* authentication );
virtual IDatastoreBaseCLI& connect( const char* aDatastoreName, 
                                    const char* aConnectString, 
                                    const char* aUserName, 
                                    const char* aAuthentication );

Use this method to establish a connection to a datastore. If you pass in a datastore name, user ID, or password, it will use these settings to attempt the connection. Otherwise, it uses the current settings of the datastoreName, userName, and authentication members (which can be set using the appropriate set methods). You can also pass in a connect string which may contain keywords and values specific to your database. Throws an exception if the connect fails, a data access error occurs, or the database logon fails.

Supported Platforms
Windows OS/2 AIX
Y Y Y

enableSaveConnectionString

public:
IDatastoreBaseCLI& enableSaveConnectionString( Boolean enable=true );

Set this to true to save the connection string that the reconnect method uses. If this setting is enabled, the connection string from the last time the connect method was used is saved for the reconnect method; otherwise, reconnect will use the connection settings used for the datastore constructor (if any were specified), or those specified with the connect "set" methods. Pass in false to disable the connect string save. Initially, this setting is turned off (isSaveConnectionString returns false).

Supported Platforms
Windows OS/2 AIX
Y Y Y

isSaveConnectionString

public:
Boolean isSaveConnectionString() const;

Use this method to find out if the connection string save is enabled. It returns a value of true if the connection string is being saved, or false if it is not. If the connection string is saved, the reconnect method will use it; otherwise, reconnect will use the connection settings used for the datastore constructor (if any were specified), or those specified with the connect "set" methods. You can turn the connection string save on and off by using the enableSaveConnectionString method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

connectionString

public:
IString connectionString() const;

Use this method to return the saved connection string, which contains all the information the datastore used to make the connection to the database. The connection string is saved on a successful connect only if saveConnectionString is enabled. The returned string may contain legible passwords. You can change this setting by calling connect with new parameters, or by calling setConnectionString.

Supported Platforms
Windows OS/2 AIX
Y Y Y

setConnectionString

public:
IDatastoreBaseCLI& setConnectionString(const char* aConnectionString);

Use this method to set the connection string to a specified value. This string will be used if the reconnect method is called. The connection string contains all the information the datastore uses to make a connection to a database. Note: If the connection string has not been set, the reconnect method uses the connection information specified in the datastore constructor, or with the connect "set" methods.

Supported Platforms
Windows OS/2 AIX
Y Y Y

connectString

public:
IString connectString() const;

Use this method to return a string of values that were passed into the last connect call. This may include all or some of the following:

Supported Platforms
Windows OS/2 AIX
Y Y Y

setConnectString

public:
IDatastoreBaseCLI& setConnectString(const char* aConnectString);

Use this method to set the connect string settings, which can include datastore name, user name, and authentification (password).

Supported Platforms
Windows OS/2 AIX
Y Y Y

accessMode

public:
AccessMode accessMode() const;

Use this method to return the access mode setting. This setting can be changed by using the setAccessMode method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

setAccessMode

public:
IDatastoreBaseCLI& setAccessMode(AccessMode option);

Use this method to set the access mode for the current datastore. You can get the current setting by calling the accessMode method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

isAutoCommit

public:
IBoolean isAutoCommit() const;

Use this method to determine whether the current datastore is set to automatically commit each transaction to the database. If it returns a value of true, the datastore is set to auto-commit. If it returns false, then you must commit a transaction before it is saved to the database, and you can roll back transactions. You can change this setting by calling the enableAutoCommit method. The default setting for a datastore is true (auto-commit is on).

Supported Platforms
Windows OS/2 AIX
Y Y Y

enableAutoCommit

public:
IDatastoreBaseCLI& enableAutoCommit(IBoolean enable = True);

Use this method to change whether the datastore is set to automatically commit transactions. Pass in a value of true to turn auto-commit on, or false to turn it off.

Supported Platforms
Windows OS/2 AIX
Y Y Y

isolationLevel

public:
IsolationLevel isolationLevel() const;

Use this method to return the current isolation level setting. You can change this setting by calling the setIsolationLevel method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

setIsolationLevel

public:
IDatastoreBaseCLI& setIsolationLevel(IsolationLevel option);

Use this method to change the isolation level setting.

Supported Platforms
Windows OS/2 AIX
Y Y Y

driverPrompt

public:
DriverPrompt driverPrompt() const;

Use this method to return the current driver prompt setting. You can change this setting by calling the setDriverPrompt method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

setDriverPrompt

public:
IDatastoreBaseCLI& setDriverPrompt( DriverPrompt option, 
                                    IWindowHandle aHandle = IWindowHandle());

Use this method to set the driver prompt setting for the datastore. You can set the driver prompt option and pass in the window handle of the parent application.

Supported Platforms
Windows OS/2 AIX
Y Y Y

ownerHandle

public:
IWindowHandle ownerHandle() const;

Use this method to return the owner handle setting for the current datastore. You can change this setting by calling the setOwnerHandle method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

setOwnerHandle

public:
IDatastoreBaseCLI& setOwnerHandle(IWindowHandle aWindowHandle);

Use this method to pass in the owner handle. See IWindowHandle documentation for more information.

Supported Platforms
Windows OS/2 AIX
Y Y Y

ODBC/CLI-Specific Methods

The following methods are for setting and returning various settings that your database may support. For more information on each of the options, see your ODBC or DB2 CLI documentation.

public:
IDAEnvironmentHandle environmentHandle() const;
IDAConnectionHandle connectionHandle() const;
void setConnectOption( short anOption, const char* aValue );
void setConnectOption( short anOption, long aValue );
IString getConnectOptionAsString( short anOption );
long getConnectOption( short anOption );
IString getInfoAsString( short anInfoType );
long getInfo( short anInfoType );
Boolean getFunctions( short aFunction );
EnvironmentType environmentType() const;
IString environmentTypeAsString() const;
Supported Platforms
Windows OS/2 AIX
Y Y Y

Other Functions

newSQLStatement

public:
IDASQLStatement* newSQLStatement();

Use this method to allocate space for a new statement for this connection.

Supported Platforms
Windows OS/2 AIX
Y Y Y

allocateDatastore

public:
static IDatastoreBaseCLI* allocateDatastore(const EnvironmentType anEnvironmentType);

Use this method to allocate a new datastore to the heap.

Supported Platforms
Windows OS/2 AIX
Y Y Y

allocateVBDatastore

public:
static IDatastoreBaseCLI* allocateVBDatastore(const EnvironmentType anEnvironmentType);

Use this method to allocate a new datastore for visual composition to the heap.

Supported Platforms
Windows OS/2 AIX
Y Y Y

asString

public:
IString asString() const;

Use this method to return the datastore name, as set with the setDatastoreName method.

Supported Platforms
Windows OS/2 AIX
Y Y Y

getConn

IDASQLConnection * getConn() const

Use this method to return the connection object associated with the datastore.

Supported Platforms
Windows OS/2 AIX
Y Y Y

cancel

public:
void cancel();

Use this method to cancel a method running on a background thread.

Supported Platforms
Windows OS/2 AIX
Y Y Y

Public Data by Category

Notification ID Support

public:
static const INotificationId connectionStringId;
static const INotificationId saveConnectionStringId;
static const INotificationId connectStringId;
static const INotificationId accessModeId;
static const INotificationId autoCommitId;
static const INotificationId isolationLevelId;
static const INotificationId driverPromptId;
static const INotificationId ownerHandleId;
Supported Platforms
Windows OS/2 AIX
Y Y Y

Protected Functions by Category

Constructor

IDatastoreBaseCLI

protected:
IDatastoreBaseCLI( EnvironmentType anEnvironmentType, 
                   const char* datastoreName = 0, 
                   const char* connectString = 0 );
Supported Platforms
Windows OS/2 AIX
Y Y Y

Datastore Actions for Override

doConnect

protected:
virtual void doConnect( const char* aUserName,
                        const char* aAuthentication ) = 0;

Override this method to change how the connect method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

doDisconnect

protected:
virtual void doDisconnect() = 0;

Override this method to change how the disconnect method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

doReconnect

protected:
virtual void doReconnect() = 0;

Override this method to change how the reconnect method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

doCommit

protected:
virtual void doCommit() = 0;

Override this method to change how the commit method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

doRollback

protected:
virtual void doRollback() = 0;

Override this method to change how the rollback method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

doExecuteSQL

protected:
virtual void doExecuteSQL(const char* aCmd) = 0;

Override this method to change how the executeSQL method behaves.

Supported Platforms
Windows OS/2 AIX
Y Y Y

sqlConnection

protected:
IDASQLConnection* sqlConnection() const;

Use this method to return the sqlConnection for the current datastore.

Supported Platforms
Windows OS/2 AIX
Y Y Y

sqlEnvironment

protected:
IDASQLEnvironment* sqlEnvironment() const;

Use this method to return the sqlEnvironment for the current datastore.

Supported Platforms
Windows OS/2 AIX
Y Y Y

Inherited Members

Inherited from IDatastoreBase:

Public Functions

Public Data

Protected Functions