23
Web-Database Integration Week 8 LBSC 690 Information Technology

Web-Database Integration Week 8 LBSC 690 Information Technology

  • View
    217

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Web-Database Integration Week 8 LBSC 690 Information Technology

Web-Database Integration

Week 8

LBSC 690

Information Technology

Page 2: Web-Database Integration Week 8 LBSC 690 Information Technology

Agenda

• Questions

• PHP

• SQL

• Midterm review

Page 3: Web-Database Integration Week 8 LBSC 690 Information Technology

Ways of Generating Web Pages

• Static: Written in a markup language– HTML, XML

• Dynamic: Generated using a program– Common Gateway Interface (.cgi)– Java servlets

• Dynamic: Generated from a database– Cold Fusion (.cfm)– PHP (.php)

Page 4: Web-Database Integration Week 8 LBSC 690 Information Technology

Why Database-Generated Pages?

• Remote access to a database – Client does not need the database software

• Serve rapidly changing information– e.g., Airline reservation systems

• Provide multiple “access points”– By subject, by date, by author, …

• Record user responses in the database

Page 5: Web-Database Integration Week 8 LBSC 690 Information Technology

Three Ways to Serve Data

WebBrowser

Cold FusionServer

MicrosoftAccess

MicrosoftWeb Server

.mdb

PHP-enabledWeb Server

mysqlDBMS

mysqldatabase

Page 6: Web-Database Integration Week 8 LBSC 690 Information Technology

Data Access Pages

Page 7: Web-Database Integration Week 8 LBSC 690 Information Technology

PHP Examples

• Demo 1: a “Hello World” program

• Demo 2: Reading input from a form

• Demo 3: Printing output from a table

Page 8: Web-Database Integration Week 8 LBSC 690 Information Technology

Structured Query Language

DESCRIBE Flight;

Page 9: Web-Database Integration Week 8 LBSC 690 Information Technology

Structured Query Language

SELECT * FROM Flight;

Page 10: Web-Database Integration Week 8 LBSC 690 Information Technology

Structured Query Language

SELECT Company.CompanyName, Company.CompanyPhone, Flight.Origin, Flight.DepartureTime

FROM Flight,Company

WHERE Flight.CompanyName=Company.CompanyName

AND Flight.AvailableSeats>3;

Page 11: Web-Database Integration Week 8 LBSC 690 Information Technology

The mysql DBMS

mysql –u dbname –h host –p password

show databases;

use RentAPlane;

show tables;

describe Flight;

select * from Flight;

insert into …

Page 12: Web-Database Integration Week 8 LBSC 690 Information Technology

Cold Fusion<HTML>

<HEAD>

<TITLE>Show All Students in Our School</TITLE> <CFQUERY NAME=“allStudents” DATASOURCE=“student20”>

SELECT * FROM Students

</CFQUERY> </HEAD>

<BODY BGCOLOR="LIGHTBLUE"> <H2> <B>All Students in Our School</B> </H2> <BR> <hr> <pre> studentID FirstName MiddleName LastName<br></pre>

<CFOUTPUT QUERY="allStudents"> <PRE> #studentID# #FirstName# #MiddleName# #LastName# </PRE>

</CFOUTPUT> <FORM ACTION="mainMenu.cfm" Method="post">

<input type="submit" value="Main Menu"> </FORM>

</BODY> </HTML>

Must be the same name

CF variables

Page 13: Web-Database Integration Week 8 LBSC 690 Information Technology

SQL in ColdFusion

• Show who borrowed which book

<CFQUERY name="borrowedBook" dataSource="student20"> SELECT Books.Title, Students.FirstName, Students.MiddleName,

Students.LastName, Checkout.DueDate FROM Books, Students, Checkout WHERE Books.BookID=Checkout.BookID AND

Students.StudentID=Checkout.StudentID;</CFQUERY>

Page 14: Web-Database Integration Week 8 LBSC 690 Information Technology

The Grand Plan

Networks

XML

Multimedia

Computers

Interaction

Search

Communication

Web

Life Cycle

PolicyDatabases

Programming

Web Databases

Midterm

Project

Final

Quiz

Page 15: Web-Database Integration Week 8 LBSC 690 Information Technology

The Midterm

• Quiz/homework should be good preparation– A variety of question types– Some questions will require computer use

• Lots of prior exams are available– Many have solutions available

• Open book/notes/Internet/mind/…– Just don’t get help from another person

Page 16: Web-Database Integration Week 8 LBSC 690 Information Technology

Computer Systems

• Hardware – Types of hardware– Storage hierarchy– Moore’s law

• Software– Types of software– Types of interfaces

Page 17: Web-Database Integration Week 8 LBSC 690 Information Technology

Networks

• Types of Networks– LAN, WAN, Internet, Wireless

• Packet Switching– Ethernet, routers, routing tables

• Layered Architecture and protocols– TCP/UDP

– IP address/domain name

• Encryption

Page 18: Web-Database Integration Week 8 LBSC 690 Information Technology

Structured Documents

My Browser

• The Web– HTTP, HTML, URL

• XML

Page 19: Web-Database Integration Week 8 LBSC 690 Information Technology

Multimedia• Compression, compression, compression

– Image: lossy vs loseless– Video: frames are alike– Speech: voice predictable– Music: masking

• Streaming

Media Sever

Internet

Buffer

Page 20: Web-Database Integration Week 8 LBSC 690 Information Technology

Human-Computer Interaction

• Input and output devices

• Mental models

• Interaction styles– Direct manipulation, menus, command line

Page 21: Web-Database Integration Week 8 LBSC 690 Information Technology

Programming• Programming languages

– Machines require low-level specific instructions

– Humans require high-level abstraction

• Can create any behavior from 3 control structures– Sequential execution

– Conditional

– Iteration

• Javascript interpreters are in Web browsers

Page 22: Web-Database Integration Week 8 LBSC 690 Information Technology

Databases• Structured information

– Field->record->table->database

– Primary key

• Normalized tables (relations)– Remove redundancy, inconsistency, error

– Easy update, search

• Join links tables together– Through foreign key

• Access provides visual operations

Page 23: Web-Database Integration Week 8 LBSC 690 Information Technology

Web-Database Integration

• Access “Data Access Pages”

• PHP

• SQL