CheckDatabaseResult CheckDatabase(OdId tOb)
tOb. Moniker of repository object that is database.
The CheckDatabase operation checks connection to the DBMS server, which the database is set up to work with.
To execute the operation, in the tOb field specify moniker of the repository object that is a database. The object moniker can be obtained on executing the GetObjects operation.
The operation results in the connection check status.
Below is the example of checking connection to the DBMS server, which the database is set up to work with. The request contains database moniker in the repository. The response contains whether connection was successful.
The example uses the FindObjectById function, which code is given in the Getting Object Description by Its Identifier example.
{
"CheckDatabase" :
{
"tOb" :
{
"id" : "GDDDOLIINILHGOAEPLFHMCEACBLGJGHEAKHGLPEKDKEIIJNJ!M!52"
}
}
}
{
"CheckDatabaseResult" :
{
"status" : "1"
}
}
public static CheckDatabaseResult CheckDatabase(MbId mb, string id)
{
var somClient = new SomPortTypeClient(); // Proxy object for operation execution
// Operation execution parameters
var tCheck = new CheckDatabase()
{
tOb = new OdId() { id = mb.id + "!" + FindObjectById(mb, id).k }
};
// Check database connection
var tResult = somClient.CheckDatabase(tCheck);
return tResult;
}
See also: