Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Lecture plan • Information retrieval (from week 11) • Databases and the Web Jane Reid, BSc/IT DB, QMUL, 25/3/02 1 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) Jane Reid, BSc/IT DB, QMUL, 25/3/02 2 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 3 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 4 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 5 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 6 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 7 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 8 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 9 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 Jane Reid, BSc/IT DB, QMUL, 25/3/02 10