All database specific information is kept in CROFT separating from the program code. A Database Access Specification (DAS) contains information for the BEE system to gain access to the data, parameters like Database Type, Database Host, Database Name, and the Username and password. This information is stored within CROFT and can be uniquely identified by the idURL and an identifier called DBID.
For example:
idURL DAS: Database Name – Database Type
www.mywebsite.com Marketing – MySQL database www.mywebsite.com/order.htm Ordering – Microsoft access database www.mywebsite.com/checkacct Accounting – Oracle database www.mywebsite.com/checkacct/news Marketing – MySQL database
If a page can be derived from multiple idURL, the longer one will be used to identify the DAS. For example, http://www.mywebsite.com.au/checkacct/billing.htm can be derived from idURL www.mywebsite.com or www.mywebsite.com/checkacct. In that case, the longer one (www.mywebsite.com/checkacct) will prevail. i.e. the billing.htm page will access the Oracle database "Accounting" (not the MySQL database "Marketing").
In the actual coding, there is no preparation of a database access. You simply launch a "database" BEE Command with the SQL query and/or some other parameters, CROFT will then automatically find the corresponding database on the host specified by the DAS, open it with the DAS username and password through the mechanism of the specified type, and the result is passed back via a database result variable. This simplifies the web page coding to a single command, and makes it portable across platform.
In rare occasions (usually when combining results from heterogeneous systems) which needs to access several DASes in one single page, you can use the DBID identifier to uniquely identified the DAS for the SQL.
For example: http://www.mywebsite.com/newsheadline.htm DBID= database – advertising http://www.mywebsite.com/newsheadline.htm DBID=world database – worldnews http://www.mywebsite.com/newsheadline.htm DBID=sports database – sportsnews
The DBID is only an identifier and is not related to the name of the database or server parameters. Therefore, specifying the DBID in the program code does not make it any less platform-independent or more difficult to port across platform. The code is still separated from the knowledge of the DAS even with DBID.
|