Connecting a Database to a Web Application Professor Stephen K. Kwan.

Slides:



Advertisements
Similar presentations
Overview Environment for Internet database connectivity
Advertisements

WEB DESIGN TABLES, PAGE LAYOUT AND FORMS. Page Layout Page Layout is an important part of web design Why do you think your page layout is important?
44238: Dynamic Web-site Development Working with a Remote Database Ian Perry Room:C48 Extension:7287
DT211/3 Internet Application Development Active Server Pages & IIS Web server.
Server Side Programming ASP1 Server Side Programming Database Integration Peter O’Grady.
ASP Tutorial. What is ASP? ASP (Active Server Pages) is a Microsoft technology that enables you to make dynamic and interactive web pages. –ASP usually.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
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.
1 Active Server Pages Active Server Pages (ASPs) are Web pages ASP = server-side scripts + HTML The appearance of an Active Server Page depends on who.
4/8/99 C. Edward Chow Page 1 Active Server Page It is a server-side scripting environment for creating dynamic content. ASP are files with.asp extension,
DT228/3 Web Development Databases. Database Almost all web application on the net access a database e.g. shopping sites, message boards, search engines.
Robofest 2001 Online Management System Jim Needham MCS 4833/01 Senior Project Dr. Chan-Jin Chung, Ph.D.
4/8/99 C. Edward Chow Page 1 Internet Services Manager Click Start | Programs | Administrative Tools | Internet Services Manager.
2/22/00J. Alberto Espinosa -- CMU/GSIA MIS Dynamic HTML Using Active Server Pages (ASP) Alberto Espinosa MIS
Figure 1. Hit analysis in 2002 of database-driven web applications Hits by Category in 2002 N = 73,873 Results Reporting 27% GME 26% Research 20% Bed Availability.
Chapter 10 Publishing and Maintaining Your Web Site.
Michael Tucker DBA / Webmaster Forsyth County Public Library.
+ Connecting to the Web Week 7, Lecture A. + Midterm Basics Thursday February 28 during Class The lab Tuesday, February 26 is optional review Class on.
1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB.
Copyright © Texas Education Agency, All rights reserved.1 Web Technologies Web Administration.
FrontPage 2000 Web Page Database Connectivity. Client /Server Architecture Database Server PCs Middleware.
Server-side Scripting Powering the webs favourite services.
What is IIS? IIS (Internet Information Server) is a group of Internet servers (including a Web or Hypertext Transfer Protocol server and a File Transfer.
Interacting With Data Databases.
4-1 INTERNET DATABASE CONNECTOR Colorado Technical University IT420 Tim Peterson.
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.
1998 PI System Users’ Conference PI on the Web: A Primer for PI Users Omicron Consulting 1998 PI System Users’ Conference.
1 Tutorial 2 ABC Web site. Objective Learning web applications design Conducting assumed business logic online Connecting the Database with the web pages.
Server Side Programming ASP1 Server Side Programming Database Integration (cont.) Internet Systems Design.
Internet, intranet, and multimedia database processing l Database processing across local and wide area networks l Alternative architectures for distributing.
COLD FUSION Deepak Sethi. What is it…. Cold fusion is a complete web application server mainly used for developing e-business applications. It allows.
How did the internet develop?. What is Internet? The internet is a network of computers linking many different types of computers all over the world.
Web Server Administration Chapter 7 Installing and Testing a Programming Environment.
Tutorial 10 by Sam ine1020 Introduction to Internet Engineering 1 Database & Server-side Scripting Tutorial 10.
 2004 Prentice Hall, Inc. All rights reserved. 1 Segment – 6 Web Server & database.
Department of Computer Science 1 Web/Database Integration with Active Server Pages 17 May 2000 Seree Chinodom Computer Science Department.
Lecture Note 1: Getting Started With ASP.  Introduction to ASP  Introduction to ASP An ASP file can contain text, HTML tags and scripts. Scripts in.
Mainframe (Host) - Communications - User Interface - Business Logic - DBMS - Operating System - Storage (DB Files) Terminal (Display/Keyboard) Terminal.
LOGO FORMs in HTML CHAPTER 5 Eastern Mediterranean University School of Computing and Technology Department of Information Technology ITEC229 Client-Side.
Using the Internet. (WWW) and the Internet The World Wide Web (WWW) is a small part of the Internet. The Internet relates to all the hardware and software.
How to Connect to Database ODBC (Open Database Connectivity) ADO (ActiveX Data Object) ASP Code To Connect to Database Recordset Object Navigating through.
DATABASE CONNECTIVITY TO MYSQL. Introduction =>A real life application needs to manipulate data stored in a Database. =>A database is a collection of.
1 Web/Database Integration with Active Server Pages 15th/16th October 1998 Nick Gould Faculty of Economic and Social.
CONTENTS  Definition And History  Basic services of INTERNET  The World Wide Web (W.W.W.)  WWW browsers  INTERNET search engines  Uses of INTERNET.
CITA 310 Section 7 Installing and Testing a Programming Environment (Textbook Chapter 7)
Web Technologies Lecture 8 Server side web. Client Side vs. Server Side Web Client-side code executes on the end-user's computer, usually within a web.
WEB SERVER SOFTWARE FEATURE SETS
The business logic engine for Microsoft IIS Speaker T.M. Arnett.
Database Connectivity What is ADO. What is ADO? ADO is a Microsoft technology ADO stands for ActiveX Data Objects ADO is a Microsoft Active-X component.
CSI 3125, Preliminaries, page 1 JDBC. CSI 3125, Preliminaries, page 2 JDBC JDBC stands for Java Database Connectivity, which is a standard Java API (application.
ASP. ASP is a powerful tool for making dynamic and interactive Web pages An ASP file can contain text, HTML tags and scripts. Scripts in an ASP file are.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Copyright © 2002 Pearson Education, Inc. Slide 3-1 Internet II A consortium of more than 180 universities, government agencies, and private businesses.
Internet addresses By Toni Grey & Rashida Swan HTTP Stands for HyperText Transfer Protocol Is the underlying stateless protocol used by the World Wide.
COSC 2328 – Web Programming.  PHP is a server scripting language  It’s widely-used and free  It’s an alternative to Microsoft’s ASP and Ruby  PHP.
Web Design Terminology Unit 2 STEM. 1. Accessibility – a web page or site that address the users limitations or disabilities 2. Active server page (ASP)
Chapter 5 Building Your Product Catalog database Objectives Create Database. Create Table. Connect to Database. Use ASP Script to add new products. Use.
ASP Mr. Baha & Dr.Husam Osta  What is ASP?  Internet Information Services  How Does ASP Differ from HTML?  What can ASP do for you?  ASP Basic.
The Web Web Design. 3.2 The Web Focus on Reading Main Ideas A URL is an address that identifies a specific Web page. Web browsers have varying capabilities.
Internet/Web Databases
Section 6.3 Server-side Scripting
Warm Handshake with Websites, Servers and Web Servers:
Some bits on how it works
PHP / MySQL Introduction
Exploring Microsoft Office 2013 Word Comprehensive
ISC440: Web Programming 2 Server-side Scripting PHP 3
Web Page Concept and Design :
Tutorial 6 PHP & MySQL Li Xu
Graduation Project #1 University Internet Student Registration System
Presentation transcript:

Connecting a Database to a Web Application Professor Stephen K. Kwan

Motivation Saving submitted data into a database for later processing and analysis (e.g., feedback form, customer registration, etc.)Saving submitted data into a database for later processing and analysis (e.g., feedback form, customer registration, etc.) Serving data from a database based on some search criteria and/or specified category (e.g., electronic products catalog, online library catalog, etc.)Serving data from a database based on some search criteria and/or specified category (e.g., electronic products catalog, online library catalog, etc.)

Ingredients HTTP server - have access and storage privilege in a directory with executable permissionHTTP server - have access and storage privilege in a directory with executable permission A Database for the applicationA Database for the application ODBC - have ability to define a Data Set Name (DSN) on server pointing to target databaseODBC - have ability to define a Data Set Name (DSN) on server pointing to target database HTML form for submitting query or dataHTML form for submitting query or data ASP programs with desired functionalityASP programs with desired functionality

HTTP Server: Microsoft NT or 2000 Server with IIS (Internet Information Services), HTTP (Hypertext Transfer Protocol, FTP (File Transfer Protocol) and ASP (Active Server Pages) enabled Database: SQL Data Sources - Database Engines such as: MS Access, MS SQL Server, Oracle, Sybase, MySQL, DB2, etc.

Schematic of Connections HTTP SERVER N T / 2000 I I S DATABASE A S P ODBC Browser Internet

ODBC – Open Data Base Connectivity Microsoft’s middleware for connecting applications to a variety of SQL Data Sources with provided drivers. At the Control Panel of the Server – Register a Data Source Name (DSN) by associating a name with a path to a target database and the appropriate driver.

Example of an ODBC Application Example of an ODBC application

<HTML><HEAD> : Sample Form Elements HTML Form

Sample HTML Feedback Form The Cookbook Group (S99) had developed a Feedback Form for their shop. On submission of the form, the data will be posted to an Access Database which was created to receive the posted data. The form calls FEEDBACK.ASP which in turn inserts the data into the database with an Feedback Form FEEDBACK.ASP Feedback Form FEEDBACK.ASP SQL INSERT statement. The DSN: CBFEEDBACK used in the file was registered with ODBC and is connected to a database called Feedback.mdb. SQL INSERT statement. The DSN: CBFEEDBACK used in the file was registered with ODBC and is connected to a database called Feedback.mdb.

Generated SQL Statement INSERT INTO FEEDBACK (name, , findeverything, easynavigate, (name, , findeverything, easynavigate, seemoreof, american, asian, french, italian, mediterranean, mexican, cocktails, desserts, comments) VALUES('......','......','......', ); Column Names Table Name Text Values in Single Quotes

Sample HTML Query Form Query FormQuery Form

Sample Query Form title>Access DB to Web Demo Query Form Access DB to Web Demo Query Form Great Plains Music and Video, Inc. Great Plains Music and Video, Inc. Catalog Query Form Catalog Query Form <hr> Item to Search for: Item to Search for: <p><hr></form>

Output of the Query

What is the SQL Data Source? Another Query Form Query FormQuery Form Sample HTML Query Form Query FormQuery FormMicrosoft Access Access or Oracle Microsoft SQL Server SQL Server2000 or

Active Server Pages (ASP) An ASP file contains HTML and VBScript code and resides on the server. When this ASP file is requested, the server will execute the VBScript code. The execution of the code will produce additional HTML, data from a data source, computation results, etc. The end result is a HTML file being sent back to the requester’s browser. INVQUERY.ASP

Segment from ASP Program (1 of 2) <% SET CONN = Server.CreateObject("ADODB.Connection") CONN.open "WEBGTP","","" SQL = "SELECT format([item no],'#####') as [item number],[item description], [item number],[item description], format([on hand],'#####') as [In Stock], format([on hand],'#####') as [In Stock], format([price],'currency') as [List Price], "'"+ format([price],'currency') as [List Price], "'"+ request.form("DESC") +"'" as [DESCR] FROM INV request.form("DESC") +"'" as [DESCR] FROM INV WHERE [item description] LIKE '%"+ WHERE [item description] LIKE '%"+ request.form("DESC")+"%'" request.form("DESC")+"%'" SET RS = Server.CreateObject("ADODB.Recordset") RS.Open SQL, CONN, 3, 3 RS.MoveFirst RS.MoveFirst %>

Segment from ASP Program (2 of 2) <tr> <% RS.MoveNext Loop %>

Examples of Connecting a Database to a Web Application The End