Search:
|
Access:
» Applications within the Briefcase ModelRelated categories: Oracle | Database programming | Delphi Artur Mościcki, Igor KrukViewed: 5814 | Article date: 2006-05-13 17:17:52 The briefcase model is an application model which lets the user work even without access to the database, e.g. when the user is travelling with a laptop and wants to use the same applications as when he is at a company. The problem is no connection to the database server and thus having no data on the user's laptop. In the article, the authors will create an example application, using the Delphi 7 Enterprise environment and the Oracle 10g DBMS.
The briefcase model is an an application model which lets the user work even without direct access to the database, e.g. when the user is travelling with a laptop and wants to use the same applications as when at the company. The problem is no data on the user's laptop.
About the authorArtur Mościcki and Igor Kruk are fifth-year students of computer science at the Faculty of Exact Sciences of Akademia Podlaska in Siedlce. For quite some time they have been dealing with the cooperation of various environments with databases. They are also the co-authors of the book Oracle 10g i Delphi. Programowanie baz danych (Oracle 10g and Delphi. Programming Databases).You can contact the authors at the following addresses: Artur Mościcki arturmoscicki@op.pl, Igor Kruk igor.siedlce@interia.pl The briefcase model makes it possible to work even in such circumstances. In the following article we will create an example application, using the Delphi 7 Enterprise environment and the Oracle 10g DBMS. How does a briefcase model-application workFirst, the database tables are written in XML or ADTG format. Next, the files are moved to the user's computer, which contains either a copy of the same application or a slightly modified one. Afterwards the user can be away from the database and continue working with the data; the briefcase-style application reads from the downloaded XML or ADTG files instead of having a direct connection to the database. Should the user make any changes to the record set, instead of having it stored in the database it is written as a xml or adtg file. Upon returning to the company the user can then connect to the database and update the data by copying them from the modified XML or ADTG files to the database. Of course during the user's absence the original database should not be altered or edited, or at least the tables the briefcase application has based its data set on. Therefore, briefcase applications are created for databases or tables usually modified by only one person. Creating a TableIn order to be able to build the briefcase app an example table must be created first. The example table will be used to store basic information about books. Start iSQL*Plus and use it to run the following script (see Figure 1): CREATE TABLE Ksiazki ( ISBN VARCHAR2(50) PRIMARY KEY, tytul VARCHAR2(100) NOT NULL, autor VARCHAR2(100) NOT NULL, opis VARCHAR2(1000) ); Building the ApplicationWhile building the briefcase application we will make use of the ADO (ActiveX Data Objects) technology – a means of accessing databases which emerged from the OLE.DB technology and is now a part of MDAC (Microsoft Data Access Components). More information about MDAC, OLE.DB and ADO can be found on the Microsoft website (http://www.microsoft.com). Delphi 7 Enterprise features a palette of ADO controls – it is components from this palette, as well as ones from palettes: Standard, Data Access and Data Control, that will be used to build the application.
Figure 1. Creating the table Ksiazki with iSQL*Plus Creating a Connection to the DatabaseBegin by defining a connection with the Oracle 10g database:
Having taken one of these two actions the screen will show a dialogue window (shown in Figure2). As one can see in that figure, the option Use Connection String is checked by default. Another possibility of defining a connection string is to point at a DataLink file (the option Use Data Link File); this will be discussed further on in the article.
Figure 2. Dialogue window for defining a connection string
|
|
Copyright C 2006 by Software Developer's Journal. All rights reserved.








SDJ Users:
Shopping Cart









