Database implementation, Local version of the client-server mode - Databases

Database Implementation

Note that to test the work the database in question was originally implemented and tested using the Access DBMS. The user interface of the database is executed using the menu (Figure 15.3). This approach allowed not only to work out the basic provisions of the user's work with the database, but also to unify the application algorithm using the system of templates used below.

At the same time, DBMS Access encounters, as noted earlier, with serious problems of creating a network variant (distributed database), defined by the technical task. Therefore, the further presentation concerns the InterBase DBMS in the Delphi environment.

The user interface implemented in the Access DBMS

Fig. 15.3. The user interface implemented in the Access DBMS

Client-Server Mode Implementation System

Fig. 15.4. Client-Server Mode Implementation System

The database implementation system in client-server mode is shown in Fig. 15.4.

In client-server mode, two options are highlighted; local (server and client are located on the same computer) and remote (server and client - on different computers).

Let's consider sequentially named variants, while in the local version we'll omit the fragmentation procedure.

Local version of client-server mode

The client-server mode can be built using:

1) direct requests to the server (via the Query component);

2) queries through stored procedures, "located on the server.

The first method is described in detail in [19]. It is characterized by a high computing load of customers, so it is more convenient to call this method a quasi-client-server.

More literate - to implement the application algorithm - is the second way, using for the stored procedures the nested SQL language. Let's consider it in more detail.

InterBase DBMS works with a nested SQL language. At the same time, queries from the client application are made using interface SQL via the TQuery component and the Object Pascal programming language (possibly through the generated SQL query).

It is easy to see that among the data types there is no counter (autoincrement is in the Paradox DBMS). It is replaced by a special program called a generator. The generator is usually associated with a SQL statement or trigger, less often with a stored procedure.

There is no provision in InterBase for semi-automatic setting of conditions for a value, referential integrity, as in the Paradox DBMS. The conditions for the value and constraints are determined by CONSTRAINTS constraints, specified implicitly (without specifying a name) or explicit (with name) .

To implement the rest of the procedures, use additional programs called triggers. They work with the events Before * (before), After * (after) any changes in the tables. Generators, stored procedures, triggers are written in nested SQL programming language.

A. OWN OBJECTS. In the construction of the database on the server, the formation of the alias and the structure of the database is still allocated, filling out the tables with data.

Alias. Choose priem_s as the alias name. In the InterBase DBMS, all objects are placed in one file. In this regard, you should first create a database file (named priems) using the WISQL utility. It is launched via the Interbase 4.2/W1SQL element of the Windows main menu.

In the WISQL main menu, select File/Create Database and in the Create Database window, install the local version of InterBase (Local Engine), the user name (path, for example, D: studentChcrt_clpriems.gdb) and the password (by default - masterkey) of the system administrator for the local InterBase server.

For reliable Russification In the Database Options window, specify DEFAULT CHARACTER SET WIN 1251.

Pressing the OK button will save the database file.

Setting the name of the database is possible and programmatically - using the script files described later.

Now you can - to create an alias - refer to the BDE Administrator utility. In its main menu through Object/New we will select the name of the INTRBASE (INTERBASE!) Driver in the New Database Alias ​​window. We will replace it with priem s. In the right window in the SERVERNAME line, we specify the path to the created file. In the USERNAME line, specify the name SYSDBA. Right click on the alias name in the left window and select the Apply menu item and fix the created alias. Click + to the left of the alias name and enter the masterkey password in the opened window.

Let's note that the username and password are the means of protecting the database and when InterBase is used it will often be requested. While you are debugging a database, you can block this request.

The alias creation is complete.

It can be used directly in the Query component of the database chain of the same name. However, it is preferable to add a Database component (usually one for the database) to the database object in front of the Query object in the Delphi form. In it, as the AliasName property, set priern_s, and as the DataBase Name property, priem_ss. Now the alias for the Query components is priem_ss.

thematic pictures

Also We Can Offer!

Other services that we offer

If you don’t see the necessary subject, paper type, or topic in our list of available services and examples, don’t worry! We have a number of other academic disciplines to suit the needs of anyone who visits this website looking for help.

How to ...

We made your life easier with putting together a big number of articles and guidelines on how to plan and write different types of assignments (Essay, Research Paper, Dissertation etc)