中文网站
  Advanced Search
Read the latest Blogs from IT professionals in the field. Read and write community created documents. Need IT help? Ask our staff. Connect with your peers. Check our Tech Shop for posters, books and software tools. Home

8.5.2 Database Systems: The ODMG C++ Object Manipulation Language

1. Figure 8.8 is an example of ODMG C++ Object Manipulation Language.

int create account owner (String name, String address) {
Database *bank db;
bank db = Database::open("Bank-DB");
Transaction Trans;
Trans.begin();
Ref hAccount iaccount = new(bank db) Account;
Ref hCustomer icust new(bank db) Customer;
cust->name = name;
cust->address = address;
cust->accounts.insert element(account);
account->owner.insert element(cust);
: : :Code to initialize customer id, account number, etc.
Trans.commit();
}

Figure 8.8: Example of ODMG C++ Object Manipulation Language

Database System Structure: