A brief introduction to interactive database query technology based on web

Source: Internet
Author: User
Tags execution functions connect odbc variables variable web services oracle database
web| Interactive | data | database 1 Overview





Web Technology is a very new technology, it not only for the wide spread of the Internet plays a key role, but also in other related computer network application technology development plays a pivotal role, such as intranet, E-commerce, etc., at present it has become a computer network application of a major technology, Especially important technology is web dynamic technology, and interactive dynamic query technology of background database. This paper introduces the common web dynamic Technology and database interaction technology.





2 Several methods of implementing Web dynamic technology





2.1 using CGI to implement web dynamic technology





in Web applications, compared to other dynamic programming technologies, although CGI technology is a very early technology, there are many deficiencies, poor performance, the need for a large number of HTTP knowledge, inflexible and so on, but I think it is still very strong usability, because of its widespread use, many Web servers are supported. As far as the agreement is concerned, it has the characteristics of simplicity, easy mastery and quick effect. Therefore, the application examples introduced in this paper are mainly based on it.





CGI is the abbreviation of Common Gateway interface, and most Web products currently offer this service function, which can be written in any computer language, with a wide range of C, Perl, C + + languages, especially There are a lot of relevant data and programs and source code on the Internet.





its operating process, such as Figure 1,web Server accept the client browser URL request, find the CGI program, start and generate a CGI process, the system parameters and user request parameters to the CGI process, the CGI process extracted from the database data processing, produce results, feedback to the Web server, It is fed back to the client browser. This completes a request process.





Figure 1 CGI call Flow (abbreviated)





IDC (Internet Database Connector)





By using an Internet Database connector, you can publish your database and allow users to access the data with only the smallest amount of code that the developer writes. You simply provide the SQL query (which IDC will execute on the database) and the template (describing how data is displayed and collected) without having to do complex programming, which is useful for simple programs that do not need to control and validate data. It is one of the features of IIS that IIS handles. IDC and. htx files by invoking an ISAPI application named HTTPODBC.DLL, which is a discontinuous loop, as shown in Figure 2. The application should pay attention to the hidden. IDC and. htx files. Secure applications and databases.





Figure 2IDC Application Process (abbreviated)





solution based on ISAPI




The
ISAPI (Internet Server application Programming Interface) is a new interface standard provided by Microsoft's IIS for developing interactive Web applications. It uses more languages for object-oriented programming languages such as Visual C + +, Delphi, and so on, it is similar to the CGI program, but in terms of performance compared to the CGI application has a greater increase in the implementation of the Code does not need to repeat, to reduce system overhead, improve the speed of operation, with strong flexibility, And the server can be a good interface, can achieve some very complex operation and control. is divided into ISAPI extenders and ISAPI filters in two ways, the former primarily accomplishes functions similar to the CGI program, which enables a more perfect combination with IIS, overseeing all authentication requests or data sent to the user by all servers, filters across the entire server, and affects how the server works. However, ISAPI programming requires skilled developers with a strong understanding of server operations, the way in which clients communicate with the server, and skilled programming skills.





Active Server Page (Active Server Pages)





It is a new feature provided by the third edition of IIS, The essence is implemented through an ISAPI filter called Sspifilt.dll, which provides the functionality that developers can dynamically generate Web pages by using server-side scripting (VBScript or Vcscript), which can be used to connect with ActiveX controls that Access databases to enable dynamic database interaction Polling is a newer technology at the moment.





third-party solutions





Many Third-party tools can be used to help you create interactive Web applications that mainly improve the development environment of CGI programs, reduce the difficulty of developers mastering web-based database interactive applications, and help you develop applications using the familiar environment. Save the porting and reusability of existing application code. It is worth mentioning the product has the following several products:





Webaction is the Classtools company's products, Web site: http://www.classtools.com/





Tornado URL: http://www.eudev.com/tornado.htm





Webhub is a product of the HREF tools company, URL: http://www.href.com/





Foxweb is Fox Company's product, URL: http://www.foxweb.com/




A comparison of several common methods of
is shown in table 1.





Method





name





Contrast Project





Database connector IDC based on CGI technology base on ISAPI Active Server Page ASP third-party solution operating system Windows NT Window NT Window NT and specific Products Web server Mainstream Web servers support IIS IIS IIS and specific products about running speed each request needs to be called into a program, and as the number of requests increases and slows down based on the ISAPI extension interpretation, speed is generally slower due to its combination with the operating system and the Web server it is faster and more slow for programmers to require the need for HTTP, HTML, tcp\ IP and CGI protocol, SQL, at least one computer programming language familiar with HTML, SQL, IDC embedded Scripting Object-oriented programming language Delphi, Visual C + +, familiar with network environment and protocol, database interface needs to be familiar with HTML, JScript or VBScripts scripting languages, SQL with initial HTML and network knowledge, and product requirements programming language training for users of the network environment is easier and easier to easily suitable for the program scale of any small special requirements or scale of the program medium and small




Comparison of several common methods of
table 1





3 Instance





for the specific situation of daqing oil production four plants, mainly in Dbasex database and Oracle data, we mainly take two ways, Dbasex type database is generally stored in Windows NT Server, most programmers adapt to the Xbase language programming, We adopt the third party product, installs the Foxweb product on the server side, thus guaranteed that the existing software development personnel can use the FoxPro to carry on the CGI programming to achieve the interactive goal, will help make the existing programmer easier to master, thus produces the good result as soon as possible.





Install Foxweb products, one of the files named Foxweb.exe is equivalent to a common CGI program, installed in the Web server's CGI directory, the program written in Vfoxpro need to have it to explain after execution.





The global variable "CGI. Parameter name" is provided in Foxweb and the following 3 functions are mainly to pass the client and server side some information and explanation, extract the user request data of the Hypertext form and merge the text of the common Visual FoxPro program data variables, Is that it becomes the information that users can browse. FoxPro programmers need to have a thorough understanding of these and a certain hypertext knowledge to be able to do web-based programming.





? FormField (): Returns the value of a variable in the form





? Totfields (): For multiple-value variables, determine the number of variable values





? Mergetxt (): Replaces the variable between << and >> in the merge encoding




The
Oracle database primarily uses the server-side to directly install the Web services functionality provided by Oracle, on the basis of two development, or using the Oracle product's PRO*C and SQL query language to directly write CGI programs to achieve interactive use, Or use an ODBC or JDBC Database interface product to interoperate with the database.





the dynamic way of the client, a copy of the HTML form and URL of the additional query string to the server's CGI program delivery request, the CGI program to return the data in hypertext form to the customer, this way can be embedded in the scripting language for the form of preprocessing, to reduce the load of CGI programs, Improve CGI execution efficiency. Another way is to interact with Java applets, which makes the program more interactive and graphical, and because Java applets are downloaded to the client and Java applets have a strong graphics processing and application interface capability, So the CGI program only needs to extract the basic data, return to the client, which can greatly reduce the load on the server side, the operation to spread the volume of the client, so that the load is balanced.





the interface of the database is also an important aspect of implementing this, listing the data interchange diagrams and basic steps between CGI programs, ODBC, JDBC, JAVA applets, and, in any case, the need to establish the appropriate drivers and data sources on the database server before using them , please refer to the books listed later in this article for more information.





Figure 3 using ODBC to access a database (abbreviated)





the basic steps for using ODBC are: See Figure 3.





assigns an environment handle to ODBC





assign a connection handle





Connect to the database





assigns a statement handle with an SQL command





Transfer the statement





Close the connection





Disconnect and environment handle





Figure 4 using JDBC to access the database (abbreviated)




The basic steps for
to use JDBC are: See Figure 4.





Establish a connection





creates a statement object to execute the SQL statement





Execute SQL statement





closes the statement object





Close the connection





Conclusion





based on the Web Interactive database query technology introduced in this paper, the CGI programming technology based on Foxweb CGI and Java based on Oracle has been widely used in the production and development information query system of Daqing oil production four-plant, which has strong practicability. With the advent of new technologies and the understanding and depth of the web and network knowledge of programmers, we can adopt newer, better technology solutions, especially the ISAPI technology of NT Server IIS.





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.