《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 9 Application Development

Application Programs and User Interfaces Most database users do not use a query language like SQL An application program acts as the intermediary between users and the database Applications split into front-end middle layer backend Front-end:user interface ·Forms Graphical user interfaces Many interfaces are Web-based Database System Concepts-7th Edition 9.3 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 9.3 ©Silberschatz, Korth and Sudarshan th Edition Application Programs and User Interfaces ▪ Most database users do not use a query language like SQL ▪ An application program acts as the intermediary between users and the database • Applications split into ▪ front-end ▪ middle layer ▪ backend ▪ Front-end: user interface • Forms • Graphical user interfaces • Many interfaces are Web-based

Application Architecture Evolution Three distinct era's of application architecture Mainframe(1960's and 70's) Personal computer era(1980's) Web era(mid 1990's onwards) Web and Smartphone era(2010 onwards) Terminals Desktop PCs Web browsers Application Application Program Program Propietary Network or dial up phone lines Local Area Network Internet Mainframe Computer Web Application Server Database Database (a)Mainframe Era (b)Personal Computer Era (c)Web era Database System Concepts-7th Edition 9.4 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.4 ©Silberschatz, Korth and Sudarshan th Edition Application Architecture Evolution ▪ Three distinct era’s of application architecture • Mainframe (1960’s and 70’s) • Personal computer era (1980’s) • Web era (mid 1990’s onwards) • Web and Smartphone era (2010 onwards)

Web Interface Web browsers have become the de-facto standard user interface to databases Enable large numbers of users to access databases from anywhere ■ Avoid the need for downloading/installing specialized code,while providing a good graphical user interface Javascript,Flash and other scripting languages run in browser, but are downloaded transparently Examples:banks,airline and rental car reservations,university course registration and grading,an so on. Database System Concepts-7th Edition 9.5 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.5 ©Silberschatz, Korth and Sudarshan th Edition Web Interface ▪ Enable large numbers of users to access databases from anywhere ▪ Avoid the need for downloading/installing specialized code, while providing a good graphical user interface • Javascript, Flash and other scripting languages run in browser, but are downloaded transparently ▪ Examples: banks, airline and rental car reservations, university course registration and grading, an so on. Web browsers have become the de-facto standard user interface to databases

Sample HTML Source Text IDNameDepartment 00128ZhangComp.Sci. Search for: Student Instructor Name: Database System Concepts-7th Edition 9.9 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.9 ©Silberschatz, Korth and Sudarshan th Edition Sample HTML Source Text ID Name Department 00128 Zhang Comp. Sci. …. Search for: Student Instructor Name:

Display of Sample HTML Source ID Name Department 00128 Zhang Comp.Sci. 12345 Shankar Comp.Sci. 19991 Brandt History Search for: Student Name: submit Database System Concepts-7th Edition 9.10 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.10 ©Silberschatz, Korth and Sudarshan th Edition Display of Sample HTML Source Search for: Name: Student submit

Three-Layer Web Architecture web server network application server database server HTTP browser data server Database System Concepts-7th Edition 9.12 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.12 ©Silberschatz, Korth and Sudarshan th Edition Three-Layer Web Architecture

HTTP and Sessions The HTTP protocol is connectionless That is,once the server replies to a request,the server closes the connection with the client,and forgets all about the request In contrast,Unix logins,and JDBC/ODBC connections stay connected until the client disconnects retaining user authentication and other information Motivation:reduces load on server operating systems have tight limits on number of open connections on a machine Information services need session information E.g.,user authentication should be done only once per session Solution:use a cookie Database System Concepts-7th Edition 9.14 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 9.14 ©Silberschatz, Korth and Sudarshan th Edition HTTP and Sessions ▪ The HTTP protocol is connectionless • That is, once the server replies to a request, the server closes the connection with the client, and forgets all about the request • In contrast, Unix logins, and JDBC/ODBC connections stay connected until the client disconnects ▪ retaining user authentication and other information • Motivation: reduces load on server ▪ operating systems have tight limits on number of open connections on a machine ▪ Information services need session information • E.g., user authentication should be done only once per session ▪ Solution: use a cookie

Sessions and Cookies A cookie is a small piece of text containing identifying information Sent by server to browser Sent on first interaction,to identify session Sent by browser to the server that created the cookie on further interactions part of the HTTP protocol Server saves information about cookies it issued,and can use it when serving a request .E.g.,authentication information,and user preferences Cookies can be stored permanently or for a limited time Database System Concepts-7th Edition 9.15 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 9.15 ©Silberschatz, Korth and Sudarshan th Edition Sessions and Cookies ▪ A cookie is a small piece of text containing identifying information • Sent by server to browser ▪ Sent on first interaction, to identify session • Sent by browser to the server that created the cookie on further interactions ▪ part of the HTTP protocol • Server saves information about cookies it issued, and can use it when serving a request ▪ E.g., authentication information, and user preferences ▪ Cookies can be stored permanently or for a limited time

Servlets Java Servlet specification defines an APl for communication between the Web/application server and application program running in the server E.g.,methods to get parameter values from Web forms,and to send HTML text back to client Application program(also called a servlet)is loaded into the server Each request spawns a new thread in the server thread is closed once the request is serviced Programmer creates a class that inherits from HttpServlet And overrides methods doGet,doPost,... Mapping from servlet name (accessible via HTTP),to the servlet class is done in a file web.xml Done automatically by most IDEs when you create a Servlet using the IDE Database System Concepts-7th Edition 9.16 ©Silberscha乜,Korth and Sudarshan
Database System Concepts - 7 9.16 ©Silberschatz, Korth and Sudarshan th Edition Servlets ▪ Java Servlet specification defines an API for communication between the Web/application server and application program running in the server • E.g., methods to get parameter values from Web forms, and to send HTML text back to client ▪ Application program (also called a servlet) is loaded into the server • Each request spawns a new thread in the server ▪ thread is closed once the request is serviced • Programmer creates a class that inherits from HttpServlet ▪ And overrides methods doGet, doPost, … • Mapping from servlet name (accessible via HTTP), to the servlet class is done in a file web.xml ▪ Done automatically by most IDEs when you create a Servlet using the IDE

Example Servlet Code import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class PersonQueryServlet extends HttpServlet public void doGet(HttpServletRequest request,HttpServletResponse response) throws ServletException,IOException response.setContentType("text/html"); PrintWriter out response.getWriter(); out.printIn("Query Result"); out.printin(""); ....BODY OF SERVLET (next slide)... out.printIn(""); out.close(); } } Database System Concepts-7th Edition 9.17 @Silberschatz,Korth and Sudarshan
Database System Concepts - 7 9.17 ©Silberschatz, Korth and Sudarshan th Edition Example Servlet Code import java.io.*; import javax.servlet.*; import javax.servlet.http.*; public class PersonQueryServlet extends HttpServlet { public void doGet (HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { response.setContentType("text/html"); PrintWriter out = response.getWriter(); out.println(" Query Result"); out.println(""); ….. BODY OF SERVLET (next slide) … out.println(""); out.close(); } }
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 8 Complex Data Types.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 7 Normalization.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 6 Database Design Using the E-R Model.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 5 Advanced SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 4 Intermediate SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 31 Information Retrieval.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 30 XML.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 3 Introduction to SQL.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 29 Object-Based Databases.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 28 Advanced Relational Database Design.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 27 Formal-Relational Query Languages.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 26 Blockchain Databases.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 25 Advanced Application Development.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 24 Advanced Indexing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 23 Parallel and Distributed Transaction Processing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 22 Parallel and Distributed Query Processing.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 21 Parallel and Distributed Storage.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 20 Database System Architectures.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 2 Intro to Relational Model.pptx
- 《数据库系统概念 Database System Concepts》原书教学资源(第七版,PPT课件讲稿,英文版)Chapter 19 Recovery System.pptx
- 计算机科学与技术教学资源(参考文献)The generalized Cholesky factorization method for saddle point problems.pdf
- 计算机科学与技术教学资源(参考文献)Inverse updating and downdating for weighted linear least squares using M-invariant reflections.pdf
- 计算机科学与技术教学资源(参考文献)Analysis of peaks and plateaus in a Galerkin/minimal residual pair of methods.pdf
- 计算机科学与技术教学资源(参考文献)Perturbation analysis for the generalized Cholesky factorization.pdf
- 计算机科学与技术教学资源(参考文献)STABILITY OF THE MATRIX FACTORIZATION FOR SOLVING BLOCK TRIDIAGONAL SYMMETRIC INDEFINITE LINEAR SYSTEMS.pdf
- 计算机科学与技术教学资源(参考文献)A Convergent Restarted GMRES Method For Large Linear Systems.pdf
- 计算机科学与技术教学资源(参考文献)Properties and Computations of Matrix Pseudospectra.pdf
- 计算机科学与技术(参考文献)A Novel Constrained Texture Mapping Method Based on Harmonic Map.pdf
- 计算机科学与技术(参考文献)A Robust and Fast Non-local Algorithm for Image Denoising.pdf
- 计算机科学与技术(参考文献)Efficient View Manipulation for Cuboid-Structured Images.pdf
- 计算机科学与技术(参考文献)Ensemble of trusted firmware services based on TPM.pdf
- 计算机科学与技术(参考文献)Fuzzy Quantization Based Bit Transform for Low Bit-Resolution Motion Estimation.pdf
- 计算机科学与技术(参考文献)Image Completion based on Views of Large Displacement.pdf
- 计算机科学与技术(参考文献)Image and Video Retexturing.pdf
- 计算机科学与技术(参考文献)Learning-Based 3D Face Detection Using Geometric Context.pdf
- 计算机科学与技术(参考文献)Multi-view Video Summarization.pdf
- 计算机科学与技术(参考文献)Mesh-Guided Optimized Retexturing for Image and Video.pdf
- 计算机科学与技术(参考文献)Object Tracking Using Learned Feature Manifolds.pdf
- 计算机科学与技术(参考文献)PG_2012_Photo_Optimization.pdf
- 计算机科学与技术(参考文献)Pores-Preserving Face Cleaning Based on Improved Empirical Mode Decomposition.pdf