100 likes | 173 Views
Lecture plan. Information retrieval (from week 11) Databases and the Web. Web/DBMS architecture. 3-layer architecture: User interface layer (client) E.g. a Web browser Business logic and data processing layer (application server) E.g. a Web server DBMS (database server).
E N D
Lecture plan • Information retrieval (from week 11) • Databases and the Web
Web/DBMS architecture • 3-layer architecture: • User interface layer (client) • E.g. a Web browser • Business logic and data processing layer (application server) • E.g. a Web server • DBMS (database server)
Web/DBMS integration • Scripting languages • Common Gateway Interface (CGI) • Web server extensions, e.g. API • Java resources, e.g. JDBC, Servlets, JavaServer Pages (JSPs) • HTTP cookies • XML
Scripting languages • Script code is embedded in HTML, so is downloaded each time the page is accessed • Programs can be written with standard programming logic • E.g. JavaScript includes Java-based functions and scripts to respond to user input, page navigation, etc • E.g. Perl combines features of C with some Unix utilities to create and manipulate files, network sockets, database connectivity, etc
Common Gateway Interface (CGI) • A specification for transferring information between Web servers and CGI programs using CGI scripts • CGI scripts can be written in any language that supports the reading and writing of an operating system’s environment variables, e.g. Perl, Java, C • Advantages are simplicity, language independence, Web server independence, wide usage • Disadvantage is that a new process is started up each time a CGI script is invoked, which can be costly for the Web server
Web server extensions • An alternative to CGI • Non-CGI gateways , e.g. Application Programming Interfaces (APIs), can be used to add functionality to the Web server • API provides a method for creating an interface between the Web server and back-end applications using dynamic linking or shared objects • Advantages are improved functionality and performance • Disadvantage is reliance on expert programming
Java resources [1] • Java offers a large set of resources to support Web/DBMS integration • JDBC • Defines a database access API that supports basic SQL functionality • Java can be used as the host language for writing DB applications • Higher-level APIs can be built on top, e.g. the JDBC-ODBC bridge which provides JDBC access using ODBC drivers • ODBC (Open DataBase Connectivity standard) provides a common interface for accessing heterogeneous SQL DBs • A single application can thus access different SQL DBMSs through a common set of code IF the DBMSs are ODBC-compliant
Java resources [2] • Java Servlets • Programs that run on a Java-enabled Web server and build Web pages • Analagous to CGI programming, but faster, portable, more extensible, and more secure • Java Server Pages (JSPs) • A Java-based server-side scripting language that allows static HTML to be mixed with dynamically-generated HTML • Works with most Web servers, including Apache HTTP Server
HTTP cookies • A piece of information stored on the client on behalf of the server • Sent back to the server with each new client request • Can be used to store registration information or preferences
XML • Meta-language that enables designers to create their own customised tags to provide functionality not available with HTML • A restricted version of SGML (Standardised Generalised Markup Language), which itself is too complex for general use • Advantages are simplicity, platform-independence / vendor-independence and extensibility