DatabaseResult GetDatabase(OdId tOb, GetDatabaseArg tArg)
tOb. Database moniker.
tArg. Operation execution parameters.
The GetDatabase operation gets database metadata.
The operation gets parameters of connection to database server and a list of tables created on the database. To execute the operation, in the tOb field specify moniker of opened database instance, and in the tArg field specify parameters for getting metadata. The moniker can be obtained on executing the OpenDatabase operation. The operation results in the requested metadata.
The example of getting information about server connection parameters that are set for the database. The request contains moniker of opened database instance and the pattern that determines whether it is necessary to get this information. The response contains requested information.
{
"GetDatabase" :
{
"tOb" :
{
"id" : "S1!M!S!DB4"
},
"tArg" :
{
"metaGet" :
{
"obInst" : "true",
"connectionParams" : "true"
}
}
}
}
{
"GetDatabaseResult" :
{
"id" :
{
"id" : "S1!M!S!DB4"
},
"meta" :
{
"obInst" :
{
"obDesc" :
{
"@ds" : "",
"@isShortcut" : "0",
"@isLink" : "0",
"@ver" : "23",
"@hf" : "0",
"i" : "DB_DATA",
"n" : "Database",
"k" : "174189",
"c" : "513",
"p" : "9050",
"h" : "0",
"hasPrv" : "0",
"ic" : "0",
"isPermanent" : "1",
"isTemp" : "0"
}
},
"dirty" : "0",
"connectionParams" :
{
"useMetabaseLogonData" : "0",
"user" : "",
"pass" : "",
"logonDataExt" :
{
"driver" : "MSSQL2012",
"server" : "%METABASE_SERVER%",
"database" : "%METABASE_DATABASE%",
"schema" : "dbo",
"unicode" : "1",
"authentication" : "Password",
"caseSensitive" : "0",
"logonTask" :
{
"subName" : ""
},
"webServiceLogon" : "0"
},
"useUnicode" : "1",
"loginPrompt" : "1",
"useMetabaseCredentials" : "0",
"useApplicationRole" : "0",
"supportDecimal" : "0",
"supportBinaryProtocol" : "1"
}
}
}
}
public static DatabaseResult GetDBMetadata(string moniker)
{
var somClient = new SomPortTypeClient(); //Proxy object for operation execution
//Operation execution parameters
var tGet = new GetDatabase()
{
tArg = new GetDatabaseArg()
{
metaGet = new DatabaseMdPattern()
{
connectionParams = true
}
},
tOb = new OdId() { id = moniker }
};
//Get metadata
var tResult = somClient.GetDatabase(tGet);
return tResult;
}
See also: