COMP3121 E-Commerce Technologies Richard Henson University of Worcester October 2010.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Lecture plan Information retrieval (from week 11)
Copyright 2004 Monash University IMS5401 Web-based Systems Development Topic 2: Elements of the Web (g) Interactivity.
Server-Side vs. Client-Side Scripting Languages
1 Chapter 12 Working With Access 2000 on the Internet.
15 Chapter 15 Web Database Development Database Systems: Design, Implementation, and Management, Fifth Edition, Rob and Coronel.
B.Sc. Multimedia ComputingMedia Technologies Database Technologies.
INTERNET DATABASE Chapter 9. u Basics of Internet, Web, HTTP, HTML, URLs. u Advantages and disadvantages of Web as a database platform. u Approaches for.
Introduction to Web Database Processing
Kashif Jalal CA-240 (072) Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 2 of…
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.
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.
Website Development with PHP and MySQL Introduction.
How Clients and Servers Work Together. Objectives Learn about the interaction of clients and servers Explore the features and functions of Web servers.
1 Java Server Pages Can web pages be created specially for each user? What part does Java play?
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Mgt 240 Lecture Website Construction: Software and Language Alternatives March 29, 2005.
2440: 141 Web Site Administration Web Server-Side Programming Professor: Enoch E. Damson.
1 CS428 Web Engineering Lecture 18 Introduction (PHP - I)
ECA 228 Internet/Intranet Design I Intro to the Web.
Web Design Basic Concepts.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
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
6/1/2001 Supplementing Aleph Reports Using The Crystal Reports Web Component Server Presented by Bob Gerrity Head.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
Beyond DHTML So far we have seen and used: CGI programs (using Perl ) and SSI on server side Java Script, VB Script, CSS and DOM on client side. For some.
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.
Oracle8 JDBC Drivers Section 2. Common Features of Oracle JDBC Drivers The server-side and client-side Oracle JDBC drivers provide the same basic functionality.
Chapter 33 CGI Technology for Dynamic Web Documents There are two alternative forms of retrieving web documents. Instead of retrieving static HTML documents,
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2012.
About Dynamic Sites (Front End / Back End Implementations) by Janssen & Associates Affordable Website Solutions for Individuals and Small Businesses.
Web Application Programming Carol Wolf Computer Science.
1 Web Server Administration Chapter 1 The Basics of Server and Web Server Administration.
Introduction to Internet Programming (Web Based Application)
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.
M1G Introduction to Database Development 6. Building Applications.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester November 2011.
Website Design Lecture 1. Outline Introduction to the module Outline of the Assessment Schedule Lecture Static XHTML, client side and server side Why.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester October 2010.
Putting it all together Dynamic Data Base Access Norman White Stern School of Business.
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2014.
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
CERN - IT Department CH-1211 Genève 23 Switzerland t DB Development Tools Benthic SQL Developer Application Express WLCG Service Reliability.
1 MSCS 237 Overview of web technologies (A specific type of distributed systems)
Web Pages with Features. Features on Web Pages Interactive Pages –Shows current date, get server’s IP, interactive quizzes Processing Forms –Serach a.
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)
COMP3241 E-Business Technologies Richard Henson University of Worcester October 2013.
COMP3241 E-Commerce Technologies Richard Henson University of Worcester November 2014.
Introduction and Principles Web Server Scripting.
NASRULLAH KHAN.  Lecturer : Nasrullah   Website :
WEB SERVER SOFTWARE FEATURE SETS
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Web Page Designing With Dreamweaver MX\Session 1\1 of 9 Session 1 Introduction to PHP Hypertext Preprocessor - PHP.
E-commerce Architecture Ayşe Başar Bener. Client Server Architecture E-commerce is based on client/ server architecture –Client processes requesting service.
COMP3121 E-Commerce Technologies Richard Henson University of Worcester December 2009.
1 Chapter 1 INTRODUCTION TO WEB. 2 Objectives In this chapter, you will: Become familiar with the architecture of the World Wide Web Learn about communication.
PHP / MySQL Introduction
Web Development Using ASP .NET
Content of Presentation
Presentation transcript:

COMP3121 E-Commerce Technologies Richard Henson University of Worcester October 2010

Week 4 –Server-Side Scripting and Database Connectivity n Objectives:  Explain how software tools can assist with integration of the four basic components of a client-server dynamic web pages application  Identify available server-scripting & database connectivity systems  Create and use a simple database-linked server-script with Dreamweaver MX

WHY NOT Client only web applications? n In an ideal world everything would be able to run via the browser on the client machine:  faster  all data local  more controlled n If…  only small data sources, or infrequently changed data sources are used  data wasn’t being captured for a database that would be accessible by other clients, this could be the case

Example : n All written in Java Script and runs on the client machine  stores & presents product data  shows all the components and functionality expected of a shopping cart system  interfaces with systems that can be used to handle online payment n TAKE A LOOK!!!  downloadable from my website…

Critical Look at Client-end Applications n Pitfalls:  what if a large, regularly updated centralised data store needs to be accessed? »Example: search engine:  whole database would have to be downloaded every time the application is to be used!  client not powerful enough  client wouldn’t have the storage capacity  bandwidth not sufficient  local editing of code/data can compromise security n In many instances, server-scripting/interrogating a server-based database is the only way…

Location of the Database used for client-server web apps n Could be:  on the remote server containing the scripts  on an entirely different remote server elsewhere on the web n ODBC still used; for ease of connection, OLE DB software recommended… n Provided that the www address or IP address is known, the OLE DB connections software should be able to point to the database wherever it is on the net

How Server Scripts can Interact with Databases n n Contain embedded SQL code that can extract data from or send data to a database

How Server Scripts can Interact with Databases   Whenever a database is updated… » »updated data picked up by server-script when it runs » »updated data displayed on client

How Server Scripts can Interact with Databases   Whenever a browser form captures data… » »data transferred directly to relevant server » »then stored in specified database field(s)

How Server Scripts Interact with Databases n n Whenever database information needs to be presented:   database fields and records taken into server memory   data sent to local machine to be displayed within a HTML format

Making Server-Scripting easier for semi-programmers! n Dreamweaver and other tools (e.g. Visual Web Developer) can help produce the server code to manage all of these actions  great for producing web pages with templates, style sheets, forms, tables, etc.  Flexible enough to generate code is several type of script (i.e. asp, asp.net, cold fusion or php pages)  deals with connectivity software, uploading to remote server, many server scripts available »more scripts via the web using “Extension Manager” »include complex applications/components such as shopping carts…

When NOT to use web tools during web development… n n Database Design!!!   Recommended that this part is done using the RDBMS itself   Ideally, developers should use CASE tools, or at least entity-relationship diagrams   Implementation of database should follow logical database design   Development of SQL queries and server scripts should FOLLOW database implementation

Variable Passing between Dynamic Web Pages n n As the widening scope of the www became apparent, Tim Berners-Lee added several features to basic HTML syntax n n This allowed data to be passed from web pages in one location to remote server processes, using http n n ONE method = GET:   Problem: can result in v. long URLs…   “GET” function (parameter/s tagged on to the URL) e.g. » »Get /thetest.jsp?firstname=richard&password=holidays&la stname=henson&action=transferbankfunds

Variable Passing between Dynamic Web Pages n n Alternative: “POST”   designed to be used within HTML forms… n n Example of syntax, added to HTML coding within …   post /thetest.jsp firstname=richard&password=holiday s&lastname=henson&action=transfer bankfunds

How do Server Scripts work with HTML forms? n Browser:  allows HTML code to make a request to run a particular script on a server (specified location)  on positive server response, passes appropriately formatted captured HTML forms data to that server process n Server running the script:  uses data from browser as input to its process »saves results somewhere (on a database?) »optionally sends HTML info back to the browser to format and display results of processing as it wishes »optionally passes results back to the browser, usually to appear in a HTML table

CGI Scripts (pre-asp) n CGI (Common Gateway Interface)  first use of http for a client-server application  so called because different types of clients and server communicate using a common protocol (i.e. TCP/IP)  code written in “C”, not embedded with HTML  ran on Unix servers  fairly primitive client browser

Disadvantages of CGIs n n Free-standing programs connected to the Web server only through a few invocation parameters and environment variables   each cgi process… » »takes quite a lot of server memory » »has to be loaded in and out of memory before/after use n n By contrast, e.g. asp,asp.net cf or php scripts:   embedded in HTML and very tightly integrated with web server   can be configured to share the same web server process space in memory

Features of Embedded Server Scripts n n Must be of an appropriate type for the web server that is to execute the code   first line of file: declaration of language used e.g..net C# n n Take advantage of web server’s built-in connectivity technologies e.g. MDAC:   allows access to large databases held on remote web servers anywhere on the world wide web, security restrictions permitting   allowing script processes to perform many queries per second on such databases

“off the shelf” server-side code n n Packages like Dreamweaver have a library of existing server-scripts ready for use   the term “server scripts” becomes “server behaviours” n n Menu driven   "Live Objects" menu option enabling quick creation of: n n Master-Detail Pages n n Insert Pages n n Update pages

Creating new “Server behaviours” n n Dreamweaver also includes a Server Behaviour Builder   very popular with experienced developers   significantly improves the ability for end users and third parties to create additional Server Behaviours   allows programmers to incorporate advanced coding and database interaction into graphically well-designed Web pages

Interacting with the Database n n Many existing databases pre-date the www   MOST are relational n n When planning a new web-based system, it may be that the a suitable existing database already exists n n The choices are:   EITHER to convert/port data into a new DBMS   OR, assuming that existing database is relational, make use of the existing DBMS data as it stands

Choice of DBMS – entry level n n Access or MySQL - small databases   both use SQL queries n n Both have their limitations:   Access can’t support more than 10 concurrent users/queries   MySQL falls short of full SQL capability in other ways: » » b_vs_MySQL.pdfhttp:// b_vs_MySQL.pdf

Beware Earlier versions of Access! n n Even pre-2000 Access versions…   integrate integrate well with server-side scripting BUT… » »use a slightly different SQL syntax » »not automatically transferable to enterprise databases if an organisation subsequently needs to move up to a more powerful system n n Enterprise databases like SQL Server and Oracle provide full-blown programming and business logic within the database…

Choice of DBMS - Larger systems n n SQL Server or Oracle?   both standard SQL   both interface well with asp.net, php, etc.   no realistic alternatives n n However, it is possible (as a stopgap?) to create an Access Project file that can use the more powerful SQL Server database engine (e.g. Access XP, 2003)

Developing the Database n n The programming of field links etc. should reside within the database   rather than on a specific Web page n n Consequently, when something needs to be changed in the database:   just need to change the “Stored Procedure” or “View”   Pages will, perhaps with minor modifications, update automatically   Any previous investment in programming will still remain even if the developer changes platform/scripting language…

Linking the Database with the Web Server n n Using IIS:   Microsoft Data Access Components (MDAC – originally VB source code) » »freely available on the web » »enables any database system to link to IIS » »BUT more vulnerable to viruses, etc. n n Using Apache:   UNIX: no MDAC “vulnerabilities” (historically,.COM objects contained source code)   if on Windows platform, still allows use of ODBC components so flexible…

Which to Use? n n All have their adherents   all can easily go pear shaped… n n Most reliable:   all Microsoft?   no Microsoft! (but not for the faint-hearted)   Some Microsoft: » »Apache/php on Windows

Microsoft Scripting & Execution Environments n n “All Microsoft” options means using existing skills rather than learning new ones:   asp.net programming code – any language!   creating a relational database – Access is a popular platform (but limited scalability)

Mixed Environments n n e.g. Apache/php on Windows   very popular “compromise” option for non-Unix developers   Apache web server runs on Windows » »possible to run Access with ODBC drivers » »if on the same platform as IIS… n n each needs a separate TCP port (both go for 80)   Popularised in XAMPP » »free to download » »Command-line interface » »contains an implementation of php scripting language » »and an implementation of MySQL… » »doesn’t have Access-type database design components

Unix Scripting & Execution Environments n n For those who like a challenge…   Unix/Linux, Apache & PHP » »all open source software » »can therefore save a lot of money   but more difficult to get support…

More about SQL n n Developed by IBM in 1974 as Structured Query Language   took a lot of the tedium out of database programming   based on a small number of commands   one line of SQL could replace 100 lines of COBOL! n n Popularised by:   ORACLE on mid-range systems   DB2 on IBM mainframes n n Now the industry standard for databases…

Benefits of knowing SQL when creating server-scripts… n n When developing server-scripts:   generating programming code is obviously important » »e.g. input/output knowledge of syntax of that language   but the embedded database queries also have to be right... n n It figures that:   the more a developer is competent with SQL syntax…   the more elaborate interaction they will be able to achieve with database data

Basics of SQL n SELECT statement  allows field/s to be specified n FROM  Allows table/s to be specified n WHERE  conditionals based on particular field values n ORDER BY  allows results to be ordered by field/s

Datasets – Improving Download Time n Dreamweaver MX asp.net controls encourage the creation of data subsets  known as “datasets”  saves on amount of data downloaded »e.g. fields can all be held in a single table »faster processing and display  remote database access becomes a much more dynamic experience for the client/user n VERY important during on-line shopping

Creating ASP.net Datasets using SQL n The four basic SQL commands above can create a very wide range of datasets from any compatible relational database n For server behaviour compatible datasets to be created, the script has to first make a logical database connection n Dreamweaver even makes all this easy by:  using a Wizard to create a named connection  Using a further wizard to generate the SQL that will create the dataset, once the database connection has been made

Learning SQL? n n The more you know the better it is… n n Possible to practice modifying queries using Dreamweaver’s SQL query writing tool   gives you experience of server behaviours, databases, and SQL queries all at the same time   will also come in very handy in the design of the database that underpins any shopping cart system…