Presentation on theme: "1 Web Database Processing. Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB."— Presentation transcript:
Web Database Applications Static Report Publishing a report is prepared from a database application and exported to HTML DB Query Publishing an HTML form is used to submit a query and the server responds with query results Application Publishing Support transaction logic, provide concurrency control over database changes etc. Page 277
ABC web connection tutorial http://buscom.mcmaster.ca/users/yuanyu f/Tutorial_asp/homepage.html For students using facbusad1: http:/facbusad1.mcmaster.ca/users/ap1/y uanyuf/Tutorial_asp/homepage.html
Browser Connect to Web servers through URL Request and display web pages Submit data through forms Perform client site process
Web Server functions Maintaining session states Maintaining Server Side Scripting Environment Publishing Web pages
Maintaining Session States HTTP is a stateless protocol When database is used for transaction process, the Web server needs to maintain the identity of the client http://aserver/anapplication/default.asp ASP creates two objects: Application object references an application Session object references a client The properties of application and session objects can be referenced by script in ASP page
Maintaining Server Side Scripting Environment Communication with DB server Data caching Constraint enforcement View construction (XML or other) Security and control Application logic View materialization
Web browser vs. web server Personal web server allows other people view your web page if your computer is connected to internet with an IP number. You can copy any web page to your hard disk and view it using web browser without the need of local web server
ODBC Open Database Connectivity DBMS-independent means for processing relational database data ORACLE SYBASE INFORMIX Microsoft SQL server IBM DB2 Page 342
ODBC Terminology Data source: the database, its associated DBMS, operating system, and network platform Driver manager: intermediary between the application and DBMS drivers Driver: processes ODBC requests and submits SQL statements to a data source Page 343
ODBC Data Source Name A data source is a ODBC data structure that identifies a database and the DBMS that processes it. File data source: a file shared among database users System data source: local to a single computer User data source: only available to the user who created it Page 346
OLE DB Object Linking and Embedding Database; OLE DB breaks the features and functions of a DBMS up into objects Provides an object-oriented interface to data of almost any type and used as an interface to ODBC and non-relational data With OLE DB, a DBMS vendor can implement portions of their product Page 348
Object Terminology Abstraction: a generalization of something, e.g. rowset is abstraction of recordset Method: actions that an object can perform, e.g. Open, MoveFirst, Move Next, Close Property: a characteristic of an object, e.g. AllowEdit, RecordsetType of a recordset Collection: object that contains a group of other objects, e.g. a recordset is a collection of field objects Recordset.Fields.Count is a number of fields of a recordset Page 348
ADO Active Data Objects; an interface that enables programmers in almost any language (including scripting) to access OLE DB functionality Page 351
Web-to-Database Connection with Active Server Pages (ASP) A scripting environment that you can use to create and run dynamic, interactive Web server applications The Web Server find the file and then processes all the ASP code between before handing back the page. Allows for easy querying and updating of a database from a Web page http://www.learnasp.com http://www.asp101.com/samples/index.asp
A Simple Example of ASP hi.asp Today is and all is well Good Morning Good Day!
Use ASP to access database Create a data base on the server Create DSN (Data Source Name) using ODBC (Open Data Base Connectivity) In a HTML form, use action to invoke an ASP page In ASP page, connect to the database through DSN, using the values from the form to make a SQL query Execute SQL and generate a result HTML page
WYSIWYG Web Database Tool http://builder.cnet.com/webbuilding/pages/Authoring/WebDB/?tag=st.bl.3880.pro_h.bl_WebDB http://builder.cnet.com/webbuilding/pages/Authoring/WebDB/?tag=st.bl.3880.pro_h.bl_WebDB The shift from code-based approach to tools with graphical interfaces. All of the top-end WYSIWYG HTML editors have added database connectivity to some degree.
Macromedia Dreamweaver MX a professional HTML editor for designing, coding, and developing websites, web pages, and web applications. Dreamweaver helps you to build dynamic database-backed web applications using server languages such as ASP, ASP.NET, ColdFusion Markup Language (CFML), JSP, and PHP.
ASP vs. PHP ASP (Active Sever Pages) is a Microsoft product, and is usually used in conjunction with the IIS (Internet Information Server) that runs on Microsoft services. Uses Microsoft Visual Basic. PHP (Hypertext Pre Processor) is a open source program that runs on UNIX and Linux servers. Uses C++ and MySQL (free)