-Dynamic Web Pages 데이타베이스 연구실 홍 동 숙. Product HTML is static but CGI and Web server APIs aren ’ t –Using HTML, The text and the format of its display remain.

Slides:



Advertisements
Similar presentations
WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
Advertisements

Lecture plan Information retrieval (from week 11)
Java Script Session1 INTRODUCTION.
The Web Warrior Guide to Web Design Technologies
DT228/3 Web Development WWW and Client server model.
Languages for Dynamic Web Documents
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
WEB1P servintro1 Introduction to servlets and JSP Dr Jim Briggs.
BICS546 Client/Server Database Application Development.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
28/1/2001 Seminar in Databases in the Internet Environment Introduction to J ava S erver P ages technology by Naomi Chen.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
Week 2 IBS 685. Static Page Architecture The user requests the page by typing a URL in a browser The Browser requests the page from the Web Server The.
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Stanford University EH&S A Service Oriented Architecture For Rich Internet Applications Sheldon M. Heitz.
Chapter 14: Advanced Topics: DBMS, SQL, and ASP.NET
COMPUTER TERMS PART 1. COOKIE A cookie is a small amount of data generated by a website and saved by your web browser. Its purpose is to remember information.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
Overview of JSP Technology. The need of JSP With servlets, it is easy to – Read form data – Read HTTP request headers – Set HTTP status codes and response.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
INTRODUCTION TO WEB DATABASE PROGRAMMING
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
JSP Standard Tag Library
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Introduction to ASP.NET. Prehistory of ASP.NET Original Internet – text based WWW – static graphical content  HTML (client-side) Need for interactive.
Copyright © cs-tutorial.com. Introduction to Web Development In 1990 and 1991,Tim Berners-Lee created the World Wide Web at the European Laboratory for.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
Basics of Web Databases With the advent of Web database technology, Web pages are no longer static, but dynamic with connection to a back-end database.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
Chapter 17 - Deploying Java Applications on the Web1 Chapter 17 Deploying Java Applications on the Web.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
Fundamentals of Database Chapter 7 Database Technologies.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
1 Accelerated Web Development Course JavaScript and Client side programming Day 2 Rich Roth On The Net
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
Active Server Pages  In this chapter, you will learn:  How browsers and servers interacted on the Internet when the Internet first became popular 
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
MC365 Application Servers, Servlets, and Java Server Pages (JSP’s): Tomcat.
Copyright © 2002 ProsoftTraining. All rights reserved. JavaServer Pages.
CF101: Welcome to ColdFusion Simon Horwith CTO, Etrilogy Ltd.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
JS (Java Servlets). Internet evolution [1] The internet Internet started of as a static content dispersal and delivery mechanism, where files residing.
Module: Software Engineering of Web Applications Chapter 2: Technologies 1.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
CSI 3125, Preliminaries, page 1 SERVLET. CSI 3125, Preliminaries, page 2 SERVLET A servlet is a server-side software program, written in Java code, that.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Database Connectivity and Server-Side Scripting Chapter 12.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Web Programming Overview. Introduction HTML is limited - it cannot manipulate data How Web pages are extended (include): –Java: an object-oriented programming.
Java Programming: Advanced Topics 1 Building Web Applications Chapter 13.
Text TCS INTERNAL Oracle PL/SQL – Introduction. TCS INTERNAL PL SQL Introduction PLSQL means Procedural Language extension of SQL. PLSQL is a database.
Running a Forms Developer Application
Servlets.
WWW and HTTP King Fahd University of Petroleum & Minerals
z/Ware 2.0 Technical Overview
PHP / MySQL Introduction
Lecture 1: Multi-tier Architecture Overview
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Presentation transcript:

-Dynamic Web Pages 데이타베이스 연구실 홍 동 숙

Product HTML is static but CGI and Web server APIs aren ’ t –Using HTML, The text and the format of its display remain constant and cannot be changed at run time –Using CGI and major Web server APIs, you can execute a server program from an input HTML form and then generate an output HTML report based on the result of that program execution –CGI is portable but it can be slow –The Web-server unique APIs are fast but they are not portable Net.Data as a Web gateway tool –Net.Data does most of the grunt work for you and makes your job much easier when creating dynamic Web pages –Net.Data supports major Web server APIs in addition to CGI, provides access to a rich set of databases –Net.Data includes some important performance enhancement features –Net.Data serves as a good case study that illustrates many of the major issues one faces when designing and implementing a dynamic Web page generation tool

CGI(1) CGI allows you to invoke a program from a Web server that normally only knows how to process HTML documents –This can be done through a URL directly from a Web browser as an HTML anchor reference as an action attribute of a HTML form – When receiving such a URL –The Web server set up some environment variables and invokes the CGI program –The CGI program then reads the environment variables and starts executing –The CGI program further reads input data from the Web server through the standard input pipe, and it writes result data to the Web server through the standard output pipe –The Web server treats the results as a normal HTML document and returns it to the Web browser for display

CGI(2) The common architecture for Web data access using CGI involves two passes –In the first pass From a Web browser, the user downloads an HTML form using a URL The user then fills in the input data –In the second pass The user submits the HTML form whose action attribute contains a URL that specifies the name of a CGI program The Web server invokes the program that contains a SQL query on a database The CGI program collects the query results and generates a standard HTML report to be returned by the Web server for display to the user –Fg 11-1.Web Data Access Using CGI

CGI(3) Fg HTTP Process Flow Calling CGI

CGI(4) As a developer of a CGI-based data access application –You must develop or handle the input HTML form the CGI program that accesses databases the passing of input data from the HTML form to the CGI program The generation of an HTML report based on the data access results => All these are tailored for the specific application –If another application comes along, you must repeat the whole cycle again for that application –CGI can be slow so you will have to worry about replacing CGI with Web server unique APIs and so on

NET.DATA(1) Net.Data is a Web gateway tool –It provides a robust and scalable framework for creating dynamic Web pages with data originating from a variety of sources Multiple platform : HP, LINUX, OS/2, SUN, WinNT … Multiple datasource ; DB2, Oracle, ODBC data sources … Multiple language environments : Java, REXX, Perl, C++ … –It is easy to use, extendable, and fast –Fg Web Data Access Using Net.Data

NET.DATA(2) The development of Net.Data followed the evolution of Web data access –Net.Data was first introduced in 1995 to enable Web-based, server- side applications –It used static CGI processes and provided access to mainly DB2 databases (it was called DB2 WWW Connection) –In 1996, it added support for access to multiple data sources, Web server APIs, live connections, the use of Java applets and JavaScript on the client, and server-side JDBC processing –Major action items planned for future releases include visual programming tools, Fast CGI support, Java servlets(server-side includes), performance improvements, additional data sources, and additional platforms

The Net.Data Architecture(1) Net.Data applications have a 3-tier architecture –Fg The Net.Data 3-Tier Architecture

The Net.Data Architecture(2) Net.Data applications have a 3-tier architecture –Net.Data itself resides on Tier 2, a Web server –Net.Data is a Web server program that can be invoked through CGI, a Web-server specific API, or as Java servlets –Net.Data applications appear in the form of macro files, which contain HTML forms, SQL queries, and optional function calls(in Java, REXX, Perl, or C) –The user of an application invokes it from the client, Tier 1, by using a URL that specifies the Net.Data executable, the name of a macro file, and the input HTML form –When the user submits the form, its action causes a certain SQL query to be executed on the database server, Tier 3 –The result of the query is used to generate an output HTML report for display to the user

The Net.Data Architecture(3) Net.Data consists of the major components –Fg The Net.Data Component Architecture

The Net.Data Architecture(4) Net.Data consists of the major components –Macro processor It processes macro files, invokes function calls, links to language environments, and generates HTML pages –Macro files These are Net.Data applications written by users –Function library This contains Net.Data ’ s built-in functions –Language environments These are Net.Data ’ s backends or databases –Live connection It can be used to maintain and manage live connections to databases and Java virtual machines

Macro Processing(1) A Net.Data macro file is processed twice by the macro processor during a user session –In the first pass From a Web browser, the user invokes the macro processor using a URL that specifies the macro processor, the name of the macro file, and the name of an HTML section that defines the input HTML form The macro processor processes the macro file-specifically, the named HTML section The macro processor generates a standard HTML form to be returned by the Web server for display to the user –In the second pass The user submits the HTML form, whose action attribute contains a URL The macro processor again processes the macro file-specifically, the named HTML section-that contains a function call executing a SQL query on a database or invoking a procedure on other backends The macro processor makes the function call, collects the result, and generates a standard HTML report to be returned by the Web server for display to the users

Macro Processing(2) Fg Net.Data Macro Processing : Report Generation

The Macro Processor(3) The macro processor can be invoked by a Web server via a URL –This can be done directly by a user, as an HTML anchor reference, or as an action attribute of an HTML form –When invoked as a CGI or ICAPI(IBM ’ s Internet Connection API) application, filename/macro-block-name –When invoked as an NSAPI(Netscape Server API) or ISAPI(Microsoft ’ s Internet Server API) application, The macro processor processes macro file and performs the following tasks –Includes files, defines variable, and defines functions –Resolves variable references and invokes function calls –Loads in appropriate (language environment) libraries –Generates standard HTML pages

The Macro File(1) The macro file provides you with the means to add logic, variables, function calls, and reports to otherwise static HTML A macro file consists of macro statements which are denoted by a special macro symbol(% The major type of macro statements : –Blocks These are used to define HTML forms and reports, variables, functions and their reports %block-type[( … )] { … %} –Function calls These are used to invoke … ) –Control statements These can be used to control the flow of macro execution %if … [%elif … ] [%else … ] %endif –Comments %{ … %}

The Macro File(2) Three major type of macro blocks : –Define This can be used to define variables –HTML This is used to define input HTML forms and output HTML reports –Function This can be used to define language-environment specific functions Function block may include a Report block and Message block Report block –This is used to define the report to be generated Message block –This is used to define the message to be displayed in case an error occurs The macro file provides three major expressive capabilities –Variable definition and passing –Function definition and invocation –Report definition

The Macro File(3) Net.Data variables –can be used to pass values within a macro file or between a macro file and a language environment –All variables are character strings (they have no data types) –The major kinds of variables : Implicit –These contain data returned from SQL queries and from function calls Report –These can be used to customize report format SQL –These can be used to tailor access to databases User-defined –These are user-defined variables –User-defined variables can be defined in the Define block, defined in an HTML form ’ s INPUT or SELECT statement, or passed in as URL data –Once defined, user-defined variables can be referenced as $(variable- name) anywhere in the macro file

The Macro File(4) Net.Data variables –Implicit variables include : $(Nn),$(N_columnName),$(NLIST) contain column names $(Vn),$(V_columnName),$(VLIST) contain column values in the current row $(ROW_NUM) contains the row number of the current row $(NUMBER_COLUMN) contains the number of columns in the result table $(TOTAL_ROWS) contains the number of rows in the result table $(RETURN_CODE) contains the return code for use in the Message block –SQL variables include : DATABASE specifies the database to connect to LOGIN specifies the user id PASSWORD specifies the password to be used with the user id TRANSACTION_SCOPE specifies the transaction scope for SQL statements

The Macro File(5) Net.Data functions –can be used to add logic, access databases, or interact with external programs during macro execution –The major types of functions : Math, String manipulation, Table, User-defined –User-defined function contains the following information : Language environments, Name (Required) IN, OUT, and INOUT parameters (Optional) Return variable, Executable statements (Optional) Report block, Message block (Optional) Net.Data reports –Within a Function block you can use the Report block and Message block to define the report and message to be generated –The report block consists of the following : Header, ROW block, Footer –The Row block displays HTML formatted data once for each row of data returned from the function call –The Message block allows you to associate a message with each return code value generated by the function call and to specify the action for Net.Data

Language Environments(1) Net.data provides a rich set of language environments –SQL/DB2, Oracle, and Sybase with native access –ODBC –Java Applet and Java Application –REXX and Perl –System (C) Users can also build and plug in their own language environment You simply specify the SQL statement to be executed within a function body and then call the function If you want to have more control over data access, you can use the Java Applet (from the client side) or the Java Application (from the server side) language environment The Java Applet language environment can dynamically generate the following parameter specifications for an applet –NUMBER_OF_TABLES, TABLE_ _NAME, NUMBER_OF_COLUMNS, NUMBER_OF_ROWS, COLMUMN_NAME_, _VALUE_ Net.Data Java Applet Interfaces : –getNumberOfTables(), getTableNames(), getNumberOfColumns(String tableName), getNumberOfRows(String tableName), getColumnNames(String tableName), getTable(String tableName)

Language Environments(2) Fg Client-Side Application with Java Applet

Language Environments(3) Fg Server-Side Application with Java Application

Live Connection Only one database connection per macro execution –Net.Data establishes a connection to a database at the beginning of macro execution –Net.Data closes the connection at the end of macro execution Live connection allows you to create and maintain persistent connections –Live connection consists of a connection manager and cliettes –The connection manager is a separate executable from Net.Data –Cliettes are single-threaded processes that the connection manager starts, and they run continuously to service requests –Cliettes are made to handle specific language environments pre-started at Web server initialization configurable with a minimum and maximum number of processes pre-connected to specified databases or backends reusable for the same type of connection Live connection provides two major advantages –Improved performance –Multiple database access

Conclusion Net.Data takes the grunt work out of CGI programming and makes life much easier for you in generating dynamic Web pages based on live data Reference sites – – 참고 –DB2 Universal DB V7 Packages which include Net.Data –DB2 Universal Developer's Edition –DB2 Universal Database Workgroup Edition –DB2 Universal Database Enterprise Edition (EE) –DB2 Universal Database Enterprise-Extended Edition (EEE) –DB2 Connect Enterprise Edition Fee download package (you can get it from IBM Web site) –DB2 Personal Developer's Edition –DB2 Universal DB V5 (you can get it from CD) DB2 Universal Database Workgroup Edition DB2 Universal Database Enterprise Edition