1 Connecting Databases to the Web October 30 th, 2001 Xinguang Sheng Marcus Haebler.

Slides:



Advertisements
Similar presentations
Connecting to Databases. relational databases tables and relations accessed using SQL database -specific functionality –transaction processing commit.
Advertisements

Lecture plan Information retrieval (from week 11)
1 Database Driven Web Application Clients Application Servers including web servers Database Server Traditional client-server (2-tier architecture): client:
An architecture for webb applications, J2EE
BICS546 Client/Server Database Application Development.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 1.
Introduction to Web Application Architectures Web Application Architectures 18 th March 2005 Bogdan L. Vrusias
Outline IS400: Development of Business Applications on the Internet Fall 2004 Instructor: Dr. Boris Jukic Server Side Web Technologies: Part 2.
CS-422 Enterprise Computing Preview. Client Server Strategies CGI (Common Gateway Interface) Active Server Pages –Personal Home Pages (PHP) –MS Active.
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.
Introduction to Web Interface Technology (CSE2030)
1 CS6320 – Why Servlets? L. Grewe 2 What is a Servlet? Servlets are Java programs that can be run dynamically from a Web Server Servlets are Java programs.
Java Server Team 8. Overview What is a Java Server? History Architecture Advantages Disadvantages Current Technologies Conclusion.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
8 Server Side Scripting.
Apache Jakarta Tomcat Suh, Junho. Road Map Tomcat Overview Tomcat Overview History History What is Tomcat? What is Tomcat? Servlet Container.
Java Server Programming Jeff Schmitt Towson University October 15, 1998.
WHAT IS PHP PHP is an HTML-embedded scripting language primarily used for dynamic Web applications.
Web-based Software Development - An introduction.
Server-side Technologies
DAT602 Database Application Development Lecture 15 Java Server Pages Part 1.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
 2000 Deitel & Associates, Inc. All rights reserved. Chapter 24 – Web Servers (PWS, IIS, Apache, Jigsaw) Outline 24.1Introduction 24.2Microsoft Personal.
Applets & Servlets.
Programming with php By: Seth Larson. A little bit about PHP  PHP stands for PHP:  Hypertext Preprocessor  PHP is a widely-used general-purpose server-side.
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
Web Application Development Tools/Environments Tim Sigmon George Pipkin, Bill Niebel, Wade Komisar Dave Saunders, Nathan Piazza Advanced Technology Group.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Week 7 Lecture Web Database Development Samuel Conn, Asst. Professor
CIS 285 ROBINSON WINTER 2005 CIS 285 Web Application Development with Java CIS 285 Sinclair Community College Instructor: Mary Robinson.
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.
3/8/00asp00 1 Active Server Pages from Microsoft Nancy McCracken Northeast Parallel Architectures Center at Syracuse.
Introduction to ColdFusion Penn State Web 2001 Conference Brian Panulla Elmwood Media Group, LLC.
Modern Software Technologies Java™, J2EE™, JSP™, JDBC™ by Radoslav Tr. Ivanov
Web Application Programming Carol Wolf Computer Science.
11/16/2012ISC329 Isabelle Bichindaritz1 Web Database Application Development.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
Fundamentals of Database Chapter 7 Database Technologies.
(Macromedia) Cold Fusion: A Brief Overview  What is Cold Fusion?  An example of CF code  How does it compare with the others: - PHP - ASP - CGI/Perl.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
Introduction to ColdFusion Yu Fu 2003 MEC Candidate.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
2-1 WEB DATABSE INTERFACING Colorado Technical University IT420.
_______________________________________________________________________________________________________________ E-Commerce: Fundamentals and Applications1.
1 CS122B: Projects in Databases and Web Applications Spring 2015 Notes 03: Web-App Architectures Professor Chen Li Department of Computer Science CS122B.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 14 Database Connectivity and Web Technologies.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
ASP (Active Server Pages) by Bülent & Resul. Presentation Outline Introduction What is an ASP file? How does ASP work? What can ASP do? Differences Between.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Introduction and Principles Web Server Scripting.
Database Connectivity and Server-Side Scripting Chapter 12.
8 th Semester, Batch 2009 Department Of Computer Science SSUET.
1 Connecting Databases to the Web January 31 th, 2000 Seree Chinodom.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
A S P. Outline  The introduction of ASP  Why we choose ASP  How ASP works  Basic syntax rule of ASP  ASP’S object model  Limitations of ASP  Summary.
PHP stands for …….. “PHP Hypertext Pre-processor” and is a server-side scripting language like ASP. PHP scripts are executed on the server PHP supports.
Connecting Databases to the Web
CS122B: Projects in Databases and Web Applications Spring 2017
CS122B: Projects in Databases and Web Applications Winter 2017
Web-based Software Development - An introduction
Connecting Databases to the Web
Connecting Databases to the Web
Netscape Application Server
PHP / MySQL Introduction
CS122B: Projects in Databases and Web Applications Winter 2018
CS122B: Projects in Databases and Web Applications Spring 2018
Introduction of Week 11 Return assignment 9-1 Collect assignment 10-1
Presentation transcript:

1 Connecting Databases to the Web October 30 th, 2001 Xinguang Sheng Marcus Haebler

Connecting Databases to the Web2 Outline How Does Web application architecture evolves Common Gateway Interface (CGI) Java Applets Server Extensions PHP Active Server Pages/ Java Server Pages What else is out there? Architectures Extended PHP example

Connecting Databases to the Web3 First Generation Architecture

Connecting Databases to the Web4 Second Generation Architecture

Connecting Databases to the Web5 Next Generation Architecture

Connecting Databases to the Web6 Some files on server are interpreted as programs depending on either ext., flag or special directory Program is invoked and generates MIME header and HTML on stdout Web-Server Common Gateway Interface (CGI) HTTP-Request HTML-File Web-Server File-System Load File File HTML? HTML Execute Program Program?Output I/O, Network, DB

Connecting Databases to the Web7 Advantages: -Standardized: works for every web-server, browser -Flexible: Any language (C++, Perl, Java, …) can be used Disadvantages: -Statelessness: query-by-query approach -Inefficient: new process forked for every request -Security: CGI programmer is responsible for security -Updates: To update layout, one has to be a programmer CGI: Discussion

Connecting Databases to the Web8 Java Applets Web-Server HTTP-Request HTML-File Web-Server File-System Load File File Load Applet... Java-Class Requests Java-Classes Execute Applet... Java Virtual Machine (JVM) Server- Process

Connecting Databases to the Web9 Advantages: -Platform independent: works for every web-server and browser supporting Java Disadvantages: -Standalone Character: ·Entire session runs inside applet ·HTML forms are not used -Inefficient: loading can take a long time... -Resource intensive: Client needs to be state of the art -Restrictive: can only connect to server where applet was loaded from (Java VM but … can be configured) Note: Server-Process can be written in any language Java Applets: Discussion

Connecting Databases to the Web10 Java-Server-Process DB Access in Java Sybase Java Applet TCP/UDP IP Oracle... JDBC- Driver JDBC Driver manager

Connecting Databases to the Web11 Previous Approaches -Platform independent and standardized -Simple interface -Lots of programming necessary -Inefficient Server Extensions -Server is extended with handler/module -One handler for all incoming requests -Much more efficient Server Extensions

Connecting Databases to the Web12 Server Extensions: The Basic Idea File-System Web-Server HTTP-Request HTML-File Web-Server Load File File HTML? HTML I/O, Network, DB Script? Output Server Extension

Connecting Databases to the Web13 API depends on Server vendor: -Apache Foundation Apache Server: Apache API -Microsoft Internet Information Server: ISAPI -Netscape Enterprise Server: NSAPI One can define it’s own server extension, e.g. -Authentication module -Counter module Server Extensions

Connecting Databases to the Web14 Active Server Pages (ASPs) -Available in IIS and Personal Web Server -Based on VBScript, Jscript -Modular Object Model -Active Server Components -Active Data Objects (ADO) for Database access -In MS.NET ASP+, ADO+ … Active Server Pages File-System Web-Server HTTP-Request HTML-File Load File ASP-File HTML ASP-ScriptOutput I/O, Network, DB Active Server Page Scripting Engine Active Server Components

Connecting Databases to the Web15 ColdFusion File-System Web-Server HTTP-Request HTML-File Web-Server Load File File HTML? HTML CF Script? HTML Cold Fusion Server Extension Cold Fusion Application Server ODBC-DriverNative DB Directories COM/CORBA

Connecting Databases to the Web16 ColdFusion: Simple Query Proprietary Scripting Language CFML - similar to other scripting languages SELECT * FROM Persons Person List Name: #Name# Age: #Age# Salary: $#Sal# Person List Name: Tom Age: 45 Salary: $45000 Name: Jim Age: 38 Salary: $40000 Name: Karen Age: 26 Salary: $32000

Connecting Databases to the Web17 ColdFusion: Form Handling <FORM ACTION=" Find Person Person Name Tom Age: 45 Salary: $45000 <A HREF=“ Homepage SELECT * FROM Persons WHERE Name=#Form.PName# #Name# Age= #Age# Salary= $#Sal# Homepage

Connecting Databases to the Web18 ColdFusion: Misc. Issues Site admin sets up data sources very similar to the handling of ODBC data sources in MS Windows In fact ColdFusion combines techniques to access databases: -Generation of HTML code -Java Applets embedded via access the database through the application server Application server is also gateway to database for the ColdFusion IDE (ColdFusion Studio)

Connecting Databases to the Web19 PHP How does PHP differ from ASP and CF? Free, open source Many client libraries integrated Runs on any web server supporting CGIs (MS Windows or Unix) Module version for Apache File-System Web-Server HTTP-Request HTML-File Load File PHP-File HTML PHP-ScriptOutput Database APIs, other APIs SNMP, IMAP, POP3, LDAP,... PHP Module Web-Server

Connecting Databases to the Web20 PHP: A Simple Example <?PHP $db = mysql_connect("localhost", "dbuser"); mysql_select_db("mydb",$db); $result = mysql_query("SELECT * FROM employees",$db); ?> NAME POSITION <?PHP while ($myrow = mysql_fetch_row($result)) { printf(" %s %s %s \n", $myrow[1], $myrow[2], $myrow[3]); } ?>

Connecting Databases to the Web21 PHP: Misc Issues Syntax Perl/C like Form fields are available as variables in following page has e.g. image and PDF generation on the fly some OO features (e.g. classes) Version 3 installed on fling.seas.upenn.edu Version latest version (zend engine) -more OO features -is based on a different, faster scripting engine -more modular architecture The number of functions is steadily increasing

Connecting Databases to the Web22 Java Server Pages

Connecting Databases to the Web23 JSP Example—Hello.jsp My first JSP page

Connecting Databases to the Web24 And the Output IS My first JSP page Hello World

Connecting Databases to the Web25 What Else Is Out There? Java Server Pages (JSP) -similar to PHP Java Servlets -very similar to CGIs A couple of solutions from Oracle -PENN ExpressApp is based on OWS various web shop applications -all of them use a more or less sophisticated scripting language and a lot more...

Connecting Databases to the Web26 Databases Usually Used ASP -MS Jet Engine (DB engine behind MS Access) -MS SQL Server -Oracle (ODBC) ColdFusion -Oracle (native driver support) -Informix (native driver support) -Sybase (native driver support) PHP -MySQL (linked in client library) -mSQL (linked in client library) -Postgres (linked in client library) -Oracle (linked in client library)

Connecting Databases to the Web27 Architectures The architecture type depends on kind and number of servers involved Different archictures different advantages and disadvantages Generally we can distinguish between different types: -2-tier architecture -3-tier architecture -n-tier architecture What matters: SPEED

Connecting Databases to the Web28 Web-Server 2-tier Architecture Web server plus module connecting to database, LDAP, IMAP,... HTTP-Request HTML-File Module DBDirectory Mail Server SNMP 1 2

Connecting Databases to the Web29 2-tier Architecture Advantages: -easy and fast to setup -easy to administrate Disadvantages: -not fail safe (single point of failure) -scales badly on high loads

Connecting Databases to the Web30 3-tier Architecture Web server plus application server connecting to database, IMAP,... DB Mail Server SNMP Web Server [Cluster] Application Server [Cluster] Other Servers [Cluster] DB Repl.

Connecting Databases to the Web31 3-tier Architecture Advantages: -better scalabilty -more reliable through failover mechanisms -offers better load balancing Disadvantages: -complicated to set up an maintain

Connecting Databases to the Web32 Architectures: Usage 2-tier -Apache-PHP plus Database etc. 3-tier -ColdFusion 4.x, BEA Weblogic -Oracle Web Application Server? n-tier -big sites with custom systems like Yahoo, Amazon.com, eBay Classification not always 100%

Connecting Databases to the Web33 Technology Choices PHP/{Oracle|mySQL} – Minimum Setup use fling or Eniac. ASP/Access/ODBC -- Need MS IIS JSP/{Oracle|mySQL}/JDBC -- Need Tcomcat or Apache+JServ Any Other Choices?

Connecting Databases to the Web34 Extended PHP Example browser

Connecting Databases to the Web35 Extended PHP Example browser

Connecting Databases to the Web36 Plain HTML Simple SQL Web Interface for Movie Table Simple SQL Web Interface for Movie Table [PHP code here] browser

Connecting Databases to the Web37 Table Generation (Part 1) <?php /* check for query, if empty describe movies */ if (!isset($query)) { $query = "describe movies"; } else { $query = stripslashes($query); print " Your query: \"". $query. "\"\n"; } $result = mysql_query($query, $conID) or die ("Invalid query"); // disable error reporting $eLevel = error_reporting(0); ?> browser

Connecting Databases to the Web38 Table Generation (Part 2) <?php /* generate table header or catch INSERT, DELETE and UPDATE statements */ if (mysql_affected_rows($conID) > 0) print " affected ". mysql_affected_rows($conID). " row(s)! \n"; if (mysql_num_rows($result) > 0) { $noFields = mysql_num_fields($result); print " \n \n"; for ($i = 0; $i < $noFields; $i++) print " ". mysql_field_name($result, $i). " \n"; print " \n"; while ($row = mysql_fetch_array ($result)) { print " \n"; for ($i = 0; $i < $noFields; $i++) print " ". $row[$i]. " \n"; print " \n"; } print " \n"; } ?> browser

Connecting Databases to the Web39 Links Software: -Apache: -ASP: -ColdFusion: -MySQL: -Oracle: -Oracle Technet: -PHP: Others: -c|net: -DevShed: -Webmonkey: