Oracle
Enterprise Manager Application Developer's Guide
Release 1.6 A63733-01 |
|
This chapter covers the repository control interface. It describes:
The repository control interface allows you to:
If an application needs to access the repository, you need to use the repository control interface to establish a connection. If you want, you can store information specific to an application in the repository. Before you do this, you need to create the tables that an application will use. This can be done in a SQL script run during installation of the application. To store or access information in the repository:
Enterprise Manager maintains its own tables within the repository strictly for its private use. However, you may create your own tables within the repository to act as a persistent store for your application data. The advantages to doing this are:
Call GetRepLogonInfo to retrieve repository connection information
from the Console. For an example of retrieving the information from the
repository object, see the CRepLogonDlg::DoGetRepLogonInfo in the replogon.cpp
file.
After you have received the repository connect information
from the Console, you can connect to the repository using the olog call
of the Oracle Call Interface (OCI). When you have connected to the repository,
you can execute any SQL or PL/SQL statements on the application's repository
structures, such as tables or views.
Your application can also request a user's preferred credentials from the repository by calling GetPreferredCredentials. To retrieve the user's preferred credentials for a particular service you must do the following:
Call GetPreferredCredentials to retrieve the preferred credentials
for the indicated service. For an example illustrating how to retrieve
the preferred credentials, see CGetPrefCredDlg::DoGetPreferredCredentials
in the repprefc.cpp file.
This section describes the external interface calls for the repository service.
These parameters are used in multiple API calls and are described in this section.
The role that is used to connect to the database: SYSOPER, SYSDBA, or NORMAL. If the DestinationType is not a database, pConnectAs is NORMAL.
The username of the user.
This function returns the release version for the Console.
VT_BOOL GetConsoleVersion(VTS_PBSTR pVersion, VTS_PBSTR pBanner)
Name | Type | Mode |
---|---|---|
pVersion |
VTS_PBSTR |
OUT |
pBanner |
VTS_PBSTR |
OUT |
This identifies the console version, such as 1.2. It is used when programing.
This is the NLS version banner string for display in the
user interface (UI), such as the About box.
For an example illustrating GetConsoleVersion, see CGetVersionDlg::DoGetConsoleVersion
in the repver.cpp file.
This function returns the preferred credentials for the Console
user for a particular destination. If the user has not specifically set
credentials for the destination, the Console username and password are
returned.
VT_BOOL GetPreferredCredentials(VTS_BSTR DestinationType, VTS_BSTR Destination, VTS_PBSTR pUsername, VTS_PBSTR pPassword VTS_PBSTR pConnectAs)
Name | Type | Mode |
---|---|---|
DestinationType |
VTS_BSTR |
IN |
Destination |
VTS_BSTR |
IN |
pUsername |
VTS_PBSTR |
OUT |
pPassword |
VTS_PBSTR |
OUT |
pConnectAs |
VTS_PBSTR |
OUT |
The service type of the destination. See Service Types on page 6-3.
The name of the destination, such as smpsun14.
An application would call the GetPreferredCredentials function
when it wants to open a connection to a different service than the one
it connected to when it was launched. This function returns a TRUE if it
succeeds, otherwise it returns FALSE.
This function returns the username and password of the Console
user, and the service name of the repository being used by the Console
user.
VT_BOOL GetRepLogonInfo(VTS_PBSTR pUsername, VTS_PBSTR pPassword, VTS_PBSTR pService VTS_PBSTR pConnectAs)
Name | Type | Mode |
---|---|---|
pUsername |
VTS_PBSTR |
OUT |
pPassword |
VTS_PBSTR |
OUT |
pService |
VTS_PBSTR |
OUT |
pConnectAs |
VTS_PBSTR |
OUT |
The Service name of the repository.
This function returns a TRUE if it succeeds, otherwise it
returns FALSE.