Base class representing datastore connections and transactions.
Inherits from:
IBase
|
+----IVBase
|
+----INotifier
|
+----IStandardNotifier
|
+----IDatastoreBase
Inherited by:
IDatastoreBase | +----IDatastoreBaseCLI
Public Functions by Category
public: virtual ~IDatastoreBase();This destructor performs the action specified by the ActionOnDestruct setting before destroying the object.
Supported Platforms Windows OS/2 AIX Y Y Y
public: virtual IDatastoreBase& disconnect();Use this method to close the connection to the database. Throws an exception if there was no open connection, if the logoff fails, or if the disconnect fails.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IDatastoreBase& commit();Use this method to commit the current transaction to the database. Throws an exception if there is no connection or if an error occurs during database access.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IDatastoreBase& rollback();Use this method to roll back the current transaction. Changes made since the last commit call will not be committed to the database. Throws an exception if there is no connection or if an error occurs during database access.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IDatastoreBase& executeSQL(const char* aCmd);Use this method to run a dynamic SQL statement. Throws an exception if an error occurs during database access.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IDatastoreBase& connect( const char* datastoreName = 0 ); virtual IDatastoreBase& connect( const char* userName, const char* authentication); virtual IDatastoreBase& connect( const char* datastoreName, const char* userName, const char* authentication );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). 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 public: virtual IDatastoreBase& reconnect();Use this method to reestablish the last connection made, using the same settings used then. 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
public: IBoolean isConnected();Use this method to determine whether a connection has been established from the current datastore object to a database. Returns a value of true if there is a connection, or false if there is not.
Supported Platforms Windows OS/2 AIX Y Y Y public: IString asString() const;Use this method to return a string containing the current datastore name, as set with the constructor or by the setDatastoreName method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IString datastoreName() const;Use this method to return a string containing the current datastore name setting. You can make this setting by using the setDatastoreName method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IDatastoreBase& setDatastoreName(const char* aDatastoreName);Use this method to set the datastore name setting. This will be used by the connect method if no other datastore name is specified. You can retrieve this setting by using the datastoreName method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IString userName() const;Use this method to return the current user name setting. You can change this setting by using the setUserName method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IDatastoreBase& setUserName(const char* aUserName);Use this method to set the user name setting. This will be used by the connect method if no other user name is specified. You can retrieve this setting by using the userName method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IString authentication() const;Use this method to return the current password setting. You can change this setting by using the setAuthentication method.
Supported Platforms Windows OS/2 AIX Y Y Y public: IDatastoreBase& setAuthentication(const char* aAuthentication);Use this method to set the password setting. This will be used by the connect method if no other authentication is specified. You can retrieve this setting by using the authentication method.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IBoolean isODBC() const;This method, when overridden in a derived class, returns true if the associated datastore is an ODBC database, or false if it is not.
Supported Platforms Windows OS/2 AIX Y Y Y public: targetDBType getDBType() const;Use this method to return the database type for the current datastore. The enumerated type, targetDBType, is defined in this class (see Public Data by Category, below).
Supported Platforms Windows OS/2 AIX Y Y Y
public: IBoolean isAsynchronous() const;Use this method to determine whether the database operations for this datastore object will be run on a background thread. Returns true if it is set to run on a background thread, of false if it is not. You can change this setting by using the setAsynchronous method. By default, the class is not asynchronous.
Supported Platforms Windows OS/2 AIX Y Y Y public: void setAsynchronous(IBoolean enable=true);Use this method to set whether database operations for this object will run on a background thread. Pass in true if you want them to run on a background thread, or false if not. By default, the class is not asynchronous.
Supported Platforms Windows OS/2 AIX Y Y Y public: IBoolean isBusy() const;Use this method to determine whether the current datastore object is running a method (on either the background thread or the foreground thread). Only one method at a time can run on a background thread for a given object.
Supported Platforms Windows OS/2 AIX Y Y Y public: virtual IDatastoreBase& notifyObservers( const INotificationEvent& event );This method notifies observers when a notification is thrown by an object method. See documentation for IStandardNotifier.
Supported Platforms Windows OS/2 AIX Y Y Y
public: ActionOnDestruct actionOnDestruct() const;Use this method to return the action you have chosen to be performed by the destructor before releasing the object's memory. The action on destruct options are noAction (0), commitTransaction (1), and rollbackTransaction (2); the enumerated type, ActionOnDestruct, is defined in this class (see Public Data by Category, below). Set the desired action by using the setActionOnDestruct method.
public: IDatastoreBase& setActionOnDestruct(ActionOnDestruct option);Use this method to set the desired action to be performed upon destruction of the datastore object. The action on destruct options are noAction (0), commitTransaction (1), and rollbackTransaction (2). The enumerated type, ActionOnDestruct, is defined in this class (see Public Data by Category, below).
Supported Platforms Windows OS/2 AIX Y Y Y
Public Data by Category
public: enum targetDBType { DB2, Oracle, Sybase, Informix, SQLServer, MSAccess, dBase, unknown }This enumerated type represents the type of database to which the datastore object corresponds.
Supported Platforms Windows OS/2 AIX Y Y Y
public: enum ActionOnDestruct { noAction, commitTransaction, rollbackTransaction };This enumerated type represents the action to be performed by destructor. Set by using setActionOnDestruct. Useful for window closing or exception occurring.
Supported Platforms Windows OS/2 AIX Y Y Y
public: IPrivateResource guardObject;Use this object to serialize access in multithreaded applications.
Supported Platforms Windows OS/2 AIX Y Y Y
public: static const INotificationId DatastoreNameId; static const INotificationId UserNameId; static const INotificationId AuthenticationId; static const INotificationId isConnectedId; static const INotificationId connectedId; static const INotificationId disconnectedId; static const INotificationId transactedId; static const INotificationId committedId; static const INotificationId rolledbackId; static const INotificationId executedId; static const INotificationId busyId; static const INotificationId threadedId; static const INotificationId actionOnDestructId;
Supported Platforms Windows OS/2 AIX Y Y Y
Protected Functions by Category
protected: IDatastoreBase( const char* datastoreName = 0, const char* userName = 0, const char* authentication = 0);
Supported Platforms Windows OS/2 AIX Y Y Y
Datastore Actions for Override
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 protected: virtual void doDisconnect() = 0;Overridethis method to change how the disconnect method behaves.
Supported Platforms Windows OS/2 AIX Y Y Y protected: virtual void doReconnect() = 0;Overridethis method to change how the reconnect method behaves.
Supported Platforms Windows OS/2 AIX Y Y Y protected: virtual void doCommit() = 0;Overridethis method to change how the commit method behaves.
Supported Platforms Windows OS/2 AIX Y Y Y protected: virtual void doRollback() = 0;Override this method to change how the rollback method behaves.
Supported Platforms Windows OS/2 AIX Y Y Y 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
protected: void setConnected(IBoolean nowConnected = true);Used to set the connection setting. Used by connect and disconnect methods.
Supported Platforms Windows OS/2 AIX Y Y Y protected: void setBusy( IBoolean enable=true );This method is used by asynchronous methods to set the background thread busy setting.
Supported Platforms Windows OS/2 AIX Y Y Y protected: virtual IDatastoreBase& notifyObservers( const INotificationId& id );Use this method to handle notifications from the background thread if enabled.
Supported Platforms Windows OS/2 AIX Y Y Y
protected: void disconnectForDestruct();This method is called during destructor to disconnect and perform destruct action (set by using setActionOnDestruct).
Supported Platforms Windows OS/2 AIX Y Y Y
protected: void setDBType(targetDBType db);This method is used to set the type of database with which the datastore is associated.
Supported Platforms Windows OS/2 AIX Y Y Y
