MENU service case
 Website construction website design Beijing website construction high-end website production company Shangpin China
We create by embracing change
360 ° brand value__
simplified Chinese character
Simplified Chinese English

Shangpin China Joins Hands with Beisheng Internet to Create a New Chapter in Website Construction

Type: Shangpin Dynamic Learn more

Principles of Web Database Access

Source: Shangpin China | Type: website encyclopedia | Date: August 28, 2012
Beijing Website Design Company Shangpin China: Generally, there are two methods to realize the connection and application of the Web database system: one is to provide middleware on the Web server side to connect the Weh server and the database server; the other is to download the application program to the client side and directly access the database on the client side. Middleware is responsible for managing the communication between the Web server and the database server and providing application services. It can directly call external programs or script codes to access the database, so it can provide dynamic HTML pages related to the database, or execute user queries, format the query results into HTML pages, and return them to the web browser through the Weh server. The most basic middleware technologies include Common Gateway Interface (CGI) and Application program interface (ApI).

The Web database technology adopts a three-layer or multi-layer architecture, and the front end uses the browser technology based on thin client to access the database through the Web server and middleware, as shown in Figure 5-19.
 Web Database Technology

At present, the main application of Web database access technology includes the following aspects.

1. CGI

CGI is the specification of external programs for Web server runtime. Programs written according to CGI can expand the functions of the server and complete the work that the server itself cannot complete. When the external program executes, it can generate HTML documents and return the documents to the Web server. CGI applications can interact with browsers, and can also communicate with external data sources such as database servers through database APIs. For example, a CGI program can obtain data from the database server, format it into an HTML document, and send it to the browser, or store the data obtained from the browser in the database. Almost all server software supports CGI. Developers can use any built-in language of the Web server to write CGI, including popular C, C++, Visual Basie, Delphi, etc. According to different application environments, CGI can be divided into standard CGI and indirect CCI.

The standard CGI uses command line parameters or environment variables to represent the detailed request of the server. The communication between the server and the browser uses the standard input and output mode. When the server receives the CGI request from the browser, the server analyzes the request, sets the required environment variables or command parameters, and then creates a sub process to start the CGI program. After the CGI is executed, the standard output is used to return the execution results to the server. CGI can output many types, such as HTML documents, images, plain text or sound files. It can also output links to other documents.

Indirect CGI is also called buffer CGI, or WinCGI. Insert a buffer program between CGI program (which does not support standard input and output) and CGI interface, and the buffer program communicates with CGI interface using standard input and output. So. CGI programs use buffers (temporary files) instead of standard input/output for data communication. When the server receives the request from the browser, it creates a subprocess to start the buffer program, and the buffer subprocess communicates with the server. It obtains relevant data through standard input array, command line parameters and environment variables, and stores these data in an input buffer. Then the buffer subprocess creates a subprocess to start the CGI program. The CGI program reads the content input into the buffer, processes the browser's request, and saves the output content in the output buffer. The buffer process transmits the address (or temporary file) of the input buffer and output buffer to the CGI sub process through command line parameters or environment variables. The buffer process is synchronized with the CGI child process to monitor the execution status of the CGI program. When the buffer process gets the output of the CGI sub process, set the relevant environment and terminate the sub process, then communicate with the service through standard output, and return the output result of the server CGI program to the browser. Similarly, the server process and the out of buffer process should also be synchronized to monitor the execution status of the buffer process. The most obvious feature of indirect CGI is that the data exchange between the server and CGI program is through the buffer rather than the standard input and output.

It can be seen that the CGI application runs as an independent external application, competing with other processes on the server for processor resources, which will slow down the running speed. In addition, it is also a difficult process to develop Web applications with CGI. Developers should master not only HTML language, but also low-level programming language. Another well-known defect of CGI is that it does not provide the state management function. If there is no state management, every request of the browser requires a connection establishment and release process, which is inefficient. In addition, the database interface must be written manually in the special SQL language of a specific database server, and its portability is also poor.

2. Special API

At present, major companies producing Web servers and database servers have launched their own special APIs to connect the Web and database. Netscape launched NSAPI. Microsoft introduced ISAPI for connecting its Weh server IIS and database. Oracle uses the standard Wel) public gateway interface to connect its PL/SQL development environment with the Web. Using Oracle Web Server, the weh client can directly call Oracle's stored procedures to generate dynamic Web documents. The web.sql of sybase integrates the web server with the sybase SQL server and other database environments (through Omni Connect). While CGI is used to collaborate with the web server, you can also use the NSAPI of Netseape to directly connect with the web server. With the WebDataBade module of InforMix, traditional CGI programming is no longer required. It stores all Web node content and application logic in the server, and it is easy to build dynamic and multimedia rich Web applications.

3. Server side script programming technology

Currently, several representative server-side scripting technologies are ASP (Active Server Page), PHP (Personal Home Page) and JSP (Java Server Pages).

ASP is a Web application development technology launched by Microsoft in November 1996. In relevant documents, ASP is described as a script environment on the server side, which can generate and run dynamic, interactive and high-performance Weh server applications. ASP is currently recognized as the best tool for building Windows NT dynamic sites. Its full combination with ADO (Active Data Object) provides a powerful database access function and has become an important means of online database management.


Asp contains IIS and provides a server side seripping environment. The site server will automatically interpret the ASP program code as the homepage content in standard HTML format, and then send it to the browser of the user side for display. The client can browse by using a regular browser that can execute HTML code.

Although ASP has strong advantages, it still has some problems in security, such as NT memory leakage, and can only run in Windows 9x/NT/2000 environment at first. For the former, Microsoft has launched patches to make up for its shortcomings; For the latter, someone has developed software that supports AsP language on non Microsoft Wel) servers, such as Apache_ASP, chiliSoft ASP, etc., and can run AsP scripts under Red Hat, SuSE, and other operating systems. Database support includes Oracle, sybase, MysQL, etc.

PHP is an embedded scripting language that creates dynamic web pages based on the server side. When a visitor opens the home page, the server will execute PHP commands and send the execution results to the visitor's browser, which is similar to ASP. However, PHP is different from ASP in that PHP is open source and cross platform. PHP can travel far away on Windows NT and various versions of UNIX. It heavily borrows the syntax of C, Java, and Perl languages, and combines PHP's own characteristics. Compared with Web developers, it can quickly write dynamic pages. It supports most databases at present and is a sharp tool for developing enterprise websites. PHP is completely free. Users can download it freely, or even get the source code without restrictions, and add the features they need.

JSP is a new generation website development language advocated by Sun Corporation and established by many companies. It completely solves the common problem of ASP and PHP - script level execution. JSP can complete powerful site programs with the support of ServerIet and JavaBean.

ASP, PHP and JSP have their own advantages. Learners can choose a technology suitable for themselves to further study.
This article was published in UEO Marketing website construction Company Shangpin China //ihucc.com/
Source Statement: This article is original or edited by Shangpin China's editors. If it needs to be reproduced, please indicate that it is from Shangpin China. The above contents (including pictures and words) are from the Internet. If there is any infringement, please contact us in time (010-60259772).
TAG label:

What if your website can increase the number of conversions and improve customer satisfaction?

Make an appointment with a professional consultant to communicate!

* Shangpin professional consultant will contact you as soon as possible

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]

Communicate with professional consultants now!

  • National Service Hotline

    400-700-4979

  • Beijing Service Hotline

    010-60259772

Please be assured to fill in the information protection
Online consultation

Disclaimer

Thank you very much for visiting our website. Please read all the terms of this statement carefully before you use this website.

1. Part of the content of this site comes from the network, and the copyright of some articles and pictures involved belongs to the original author. The reprint of this site is for everyone to learn and exchange, and should not be used for any commercial activities.

2. This website does not assume any form of loss or injury caused by users to themselves and others due to the use of these resources.

3. For issues not covered in this statement, please refer to relevant national laws and regulations. In case of conflict between this statement and national laws and regulations, the national laws and regulations shall prevail.

4. If it infringes your legitimate rights and interests, please contact us in time, and we will delete the relevant content at the first time!

Contact: 010-60259772
E-mail: [email protected]