Database 오브젝트는 사용자 데이터베이스에 대한 정보를 저장합니다.
데이터베이스에 연관된 특성을 변경하려면 Database 오브젝트를 사용하십시오. 이 오브젝트의 특성을 사용하여 데이터베이스 이름, 설명 정보, 시간 종료 간격 및 로그인 정보를 가져오고 설정할 수 있습니다. 이 오브젝트의 메소드를 사용하여 데이터베이스에 연관된 스키마 개정판을 조정할 수 있습니다.
특성을 설정해도 데이터베이스에서 해당 값이 자동으로 업데이트되는 것은 아닙니다. 데이터베이스의 값을 업데이트하려면 ApplyPropertyChanges 메소드를 호출해야 합니다. 이 메소드를 호출할 경우 IBM® Rational® ClearQuest®에서 변경된 데이터베이스 특성 값을 업데이트합니다.
새 데이터베이스의 스키마 개정판을 설정하려면 Database 오브젝트의 SetInitialSchemaRev 메소드를 호출하십시오.
기존 데이터베이스의 스키마 개정판을 변경하려면 Database 오브젝트의 Upgade 메소드를 호출하십시오.
Database 오브젝트를 사용하여 새 사용자 데이터베이스를 작성하려면 다음 단계를 수행하십시오.
다음 예제에 데이터베이스를 작성하고 해당 초기 스키마 개정판을 설정하는 예제가 나와 있습니다.
VBScript
set adminSession = CreateObject("Rational ClearQuest.AdminSession")
set db = adminSession.CreateDatabase("newDB")
' Set initial schema to first revision of "mySchema"
set schemas = adminSession.Schemas
set mySchema = schemas.Item("mySchema")
set schemaRevs = mySchema.SchemaRevs
set firstRev = schemaRevs.Item(1)
db.SetInitialSchemaRev(firstRev)
Perl
use CQPerlExt;$adminSession= CQAdminSession::Build();
#Create a database
$db = $adminSession->CreateDatabase("newDB");
#From the list of schemas from the schema repository, get the
#"mySchema" schema
$schemas = $adminSession->GetSchemas();
$mySchema = $schemas->ItemByName("mySchema");
#From the list of all the revisions associated with "mySchema",
#get the first revision in the list
$schemaRevs = $mySchema->GetSchemaRevs();
$firstRev = $schemaRevs->Item(0);
#Set initial schema to first revision of "mySchema"
$db->SetInitialSchemaRev($firstRev);
#...
CQAdminSession::Unbuild($adminSession);