Download presentation
Presentation is loading. Please wait.
Published byAmice Ellis Modified over 9 years ago
1
2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database
2
2004 Prentice Hall, Inc. All rights reserved. 21.1 Introduction Web server –Responds to client requests by providing resources URI (Uniform Resource Identifier) Web server and client communicate with platform-independent Hypertext Transfer Protocol (HTTP)
3
2004 Prentice Hall, Inc. All rights reserved. 21.1 Introduction
4
2004 Prentice Hall, Inc. All rights reserved. 21.2 HTTP Request Types Request methods –get –post –Retrieve and send client form data to Web server –Post data to a server-side form handler
5
2004 Prentice Hall, Inc. All rights reserved. 21.3 System Architecture Multi-tier application (n-tier application) –Information tier (data or bottom tier) Maintains data for the application Stores data in a relational database management system (RDBMS) –Middle tier Implements business logic and presentation logic Control interactions between application clients and application data –Client tier (top tier) Application’s user interface Users interact directly with the application through the client tier
6
2004 Prentice Hall, Inc. All rights reserved. 21.4 Client-Side Scripting versus Server- Side Scripting Client-side scripts –Validate user input Reduce requests needed to be passed to server Access browser Enhance Web pages with DHTML, ActiveX controls, and applets Server-side scripts –Executed on server –Generate custom response for clients –Wide range of programmatic capabilities –Access to server-side software that extends server functionality
7
2004 Prentice Hall, Inc. All rights reserved. 21.5 Accessing Web Servers Request documents from Web servers –Host names –Local Web servers Access through machine name or localhost –Remote Web servers Access through machine name –Domain name or Internet Protocol (IP) address Domain name server (DNS) –Computer that maintains a database of host names and their corresponding IP address
8
2004 Prentice Hall, Inc. All rights reserved. 21.6 Microsoft Internet Information Services (IIS) An enterprise-level Web server that is included with Windows
9
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 FTP Site –Used for transferring large files across the Internet HTTP Site –Used most frequently to request documents from Web servers SMTP Virtual Server –Sends and receives electronic mail Web Site Content Directory –Directory containing the documents that clients will view
10
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 Fig. 21.3Internet Information Services window of Internet Services Manager.
11
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 Fig. 21.4Virtual Directory Creation Wizard welcome dialog.
12
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 Fig. 21.5Virtual Directory Alias dialog of the Virtual Directory Creation Wizard.
13
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 Fig. 21.6Web Site Content Directory dialog of the Virtual Directory Creation Wizard.
14
2004 Prentice Hall, Inc. All rights reserved. 21.6.1 Microsoft Internet Information Services (IIS) 5.0 Fig. 21.7Access Permissions dialog of the Virtual Directory Creation Wizard.
15
2004 Prentice Hall, Inc. All rights reserved. 21.6.2 Microsoft Internet Information Services (IIS) 6.0 Fig. 21.8Internet Information (IIS) Services Manager window.
16
2004 Prentice Hall, Inc. All rights reserved. 21.6.2 Microsoft Internet Information Services (IIS) 6.0 Fig. 21.9Virtual Directory Creation Wizard welcome dialog.
17
2004 Prentice Hall, Inc. All rights reserved. 21.6.2 Microsoft Internet Information Services (IIS) 6.0 Fig. 21.10Virtual Directory Alias dialog of the Virtual Directory Creation Wizard.
18
2004 Prentice Hall, Inc. All rights reserved. 21.6.2 Microsoft Internet Information Services (IIS) 6.0 Fig. 21.11Web Site Content Directory dialog of the Virtual Directory Creation Wizard.
19
2004 Prentice Hall, Inc. All rights reserved. 21.6.2 Microsoft Internet Information Services (IIS) 6.0 Fig. 21.12Access Permissions dialog of the Virtual Directory Creation Wizard.
20
2004 Prentice Hall, Inc. All rights reserved. 21.7 Apache Web Server Currently the most popular Web server Stability Efficiency Portability Open-source
21
2004 Prentice Hall, Inc. All rights reserved. 21.7 Apache Web Server Fig. 21.13Apache Web server starting. (Courtesy of The Apache Software Foundation.)
22
2004 Prentice Hall, Inc. All rights reserved. 22.1 Introduction Database –Integrated collection of data –Database management system (DBMS) Store and organize data consistent with database’s format Relational database –SQL (Structured Query Language) Queries Manipulate data
23
2004 Prentice Hall, Inc. All rights reserved. 22.2 Relational Database Model Composed of tables Row –Number column –Primary key Reference data in the table A column or set of columns in table contains unique data
24
2004 Prentice Hall, Inc. All rights reserved. 22.2 Relational Database Model Fig. 22.1Relational database structure of an Employee table.
25
2004 Prentice Hall, Inc. All rights reserved. 22.2 Relational Database Model departmentlocation 413New Jersey 642Los Angeles 611Orlando Fig. 22.2Table formed by selecting department and location data from the Employee table.
26
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database Primary key uniquely identifies each row –Rule of Entity Integrity Composite primary key Lines connecting tables –Relationships One-to-many relationship Foreign key –Join multiple tables –Rule of Referential Integrity
27
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
28
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
29
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
30
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
31
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
32
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database
33
2004 Prentice Hall, Inc. All rights reserved. 22.3 Relational Database Overview: Books.mdb Database Fig. 22.11Table relationships in Books.mdb.
34
2004 Prentice Hall, Inc. All rights reserved. 22.4 SQL (Structured Query Language)
35
2004 Prentice Hall, Inc. All rights reserved. 22.4.1 Basic SELECT Query SELECT * FROM tableName –SELECT * FROM Authors –SELECT authorID, lastName FROM Authors
36
2004 Prentice Hall, Inc. All rights reserved. 22.4.1 Basic SELECT Query
37
2004 Prentice Hall, Inc. All rights reserved. 22.4.2 WHERE Clause Specify selection criteria for query –SELECT columnName1, columnName2, … FROM tableName WHERE criteria SELECT title, editionNumber, copyright FROM Titles WHERE copyright > 1999 –LIKE Pattern matching –Asterisk ( * ) SELECT authorID, firstName, lastName FROM Authors WHERE lastName LIKE ‘D*’ –Question mark ( ? ) SELECT authorID, firstName, lastName FROM Authors WHERE lastName LIKE ‘?I*’
38
2004 Prentice Hall, Inc. All rights reserved. 22.4.2 WHERE Clause
39
2004 Prentice Hall, Inc. All rights reserved. 22.4.2 WHERE Clause
40
2004 Prentice Hall, Inc. All rights reserved. 22.4.2 WHERE Clause
41
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause Arranged in ascending or descending order –SELECT columnName1, columnName2, … FROM tableName ORDER BY column ASC SELECT authorID, firstName, lastName FROM Authors ORDER BY lastName ASC –SELECT columnName1, columnName2, … FROM tableName ORDER BY column DESC SELECT authorID, firstName, lastName FROM Authors ORDER BY lastName DESC
42
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause
43
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause
44
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause
45
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause
46
2004 Prentice Hall, Inc. All rights reserved. 22.4.3 ORDER BY Clause
47
2004 Prentice Hall, Inc. All rights reserved. 22.4.4 Merging Data from Multiple Tables: INNER JOIN Normalize databases –Ensure database does not store data redundantly –SELECT columnName1, columnName2, … FROM table1 INNER JOIN table2 ON table1, columnName = table2.columnName
48
2004 Prentice Hall, Inc. All rights reserved. 22.4.4 Merging Data from Multiple Tables: INNER JOIN
49
2004 Prentice Hall, Inc. All rights reserved. Outline Fig. 22.22 (1 of 1)
50
2004 Prentice Hall, Inc. All rights reserved. 22.4.5 Joining Data from Tables Authors, AuthorISBN, Titles and Publishers
51
2004 Prentice Hall, Inc. All rights reserved. 22.4.5 Joining Data from Tables Authors, AuthorISBN, Titles and Publishers
52
2004 Prentice Hall, Inc. All rights reserved. 22.4.6 INSERT Statement Inserts new row in table –INSERT INTO tableName ( columnName1, columnName2, …, columnNameN ) VALUES ( value1, value2, …, valueN )
53
2004 Prentice Hall, Inc. All rights reserved. 22.4.6 INSERT Statement
54
2004 Prentice Hall, Inc. All rights reserved. 22.4.7 UPDATE Statement Modifies data in a table –UPDATE tableName SET columnName1 = value1, columnName2 = value2, …, columnNameN = valueN WHERE criteria
55
2004 Prentice Hall, Inc. All rights reserved. 22.4.7 UPDATE Statement
56
2004 Prentice Hall, Inc. All rights reserved. 22.4.8 DELETE Statement Removes data from a table –DELETE FROM tableName WHERE criteria
57
2004 Prentice Hall, Inc. All rights reserved. 22.4.8 DELETE Statement
58
2004 Prentice Hall, Inc. All rights reserved. 22.5 MySQL Multi-user and multi-threaded RDBMS server Uses SQL to interact with and manipulate data Supports various programming languages Access tables from different databases Handle large databases
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.