Web-Database Integration Week 8 LBSC 690 Information Technology.
-
date post
19-Dec-2015 -
Category
Documents
-
view
214 -
download
0
Transcript of Web-Database Integration Week 8 LBSC 690 Information Technology.
![Page 1: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/1.jpg)
Web-Database Integration
Week 8
LBSC 690
Information Technology
![Page 2: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/2.jpg)
Agenda
• Questions
• PHP
• SQL
• Midterm review
![Page 3: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/3.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/4.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/5.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/6.jpg)
Data Access Pages
![Page 7: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/7.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/8.jpg)
Structured Query Language
DESCRIBE Flight;
![Page 9: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/9.jpg)
Structured Query Language
SELECT * FROM Flight;
![Page 10: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/10.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/11.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/12.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/13.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/14.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/15.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/16.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/17.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/18.jpg)
Structured Documents
My Browser
• The Web– HTTP, HTML, URL
• XML
![Page 19: Web-Database Integration Week 8 LBSC 690 Information Technology.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/19.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/20.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/21.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/22.jpg)
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.](https://reader030.fdocuments.us/reader030/viewer/2022032703/56649d365503460f94a0edb3/html5/thumbnails/23.jpg)
Web-Database Integration
• Access “Data Access Pages”
• PHP
• SQL