7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,...

Size: px
Start display at page:

Download "7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,..."

Transcription

1 7 Web Databases Access to Web Databases: Servlets, Applets Java Server Pages PHP, PEAR Languages: Java, PHP, Python,... Prof. Dr. Dietmar Seipel 837

2 7.1 Access to Web Databases by Servlets Java Servlets can be called using a parametrised URL (Uniform Resource Locator). To guarantee the scalability of the architecture even for very large numbers of users, the servlet engine executes the requests in parallel in several independent threads (lightweight processes). Sofware systems which are extended in that way often in combination with a Web server are called application servers. Prof. Dr. Dietmar Seipel 838

3 Formular Interface Prof. Dr. Dietmar Seipel 839

4 Query Page in HTML <html> <head><title>employees over a given Income</title></head> <body> <h1>employees over a given Income</h1> <blockquote> <form action=" method="get"> Please enter the minimum salary: <br> <input type="text" name="salary"/> <br> <input type="submit" value="submit Query"/> </form> </blockquote> </body> </html> Prof. Dr. Dietmar Seipel 840

5 The servlet implements a method doget (or dopost): start of the database connection using JDBC execution of the query generation of the HTML page which is send to the browser Parameters: The parameters which are necessary for formulating the query are computed on the client side using a formular interface. They are transferred to the servlet as an HttpServletRequest object request. The servlet accesses a paramenter Par by calling request.getparameter("par"). Output: The generated HTML document is transferred to the HttpServletResponse object using a PrintWriter object. Prof. Dr. Dietmar Seipel 841

6 GET Method When using the HTTP GET method, the parameters are transferred from the Web browser as part of the URL to the servlet, e.g.: The parameter part (following the character? ) of such a URL is often called query string. Several parameter/value pairs can be transmitted separated by &. POST Method When using the alternative HTTP POST method, the parameters are transferred invisbly from the Web browser to the servlet; they are not part of the URL. Prof. Dr. Dietmar Seipel 842

7 Java Servlet import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import java.sql.*; import java.text.*; public class EmployeeSalary extends HttpServlet { public void doget ( HttpServletRequest request, HttpServletResponse response ) throws ServletException, IOException { protected Connection con = null; initconnection(); response.setcontenttype("text/html"); PrintWriter out = response.getwriter(); String Salary = request.getparameter("salary"); generatehtmltable(salary); } } Prof. Dr. Dietmar Seipel 843

8 private void generatehtmltable(string Salary) { printhtmlheader(salary); try { String query = "SELECT * FROM employee " + "WHERE salary >= " + Salary + " "; Statement stmt = con.createstatement(); ResultSet rs = stmt.executequery(query); while (rs.next()) { out.println( "<tr><td>" + rs.getstring("fname") + "</td><td>" + rs.getstring("minit") + "</td><td>" + rs.getstring("lname") + "</td><td>" + rs.getstring("salary") + "</td></tr>" ); } } catch (Exception mye){ out.println(mye.tostring()); } printhtmlbottom(); } Prof. Dr. Dietmar Seipel 844

9 Result of the Query (HTML, in Browser) <html> <head><title>employees earning at least USD</title></head> <body> <table border="1" cellpadding="5"> <tr><th>fname</th><th>minit</th><th>lname</th><th>salary</th></tr> <tr><td>john</td><td>b</td><td>smith</td><td>30000</td></tr> <tr><td>franklin</td><td>t</td><td>wong</td><td>40000</td></tr> <tr><td>jennifer</td><td>s</td><td>wallace</td><td>43000</td></tr> <tr><td>ramesh</td><td>k</td><td>narayan</td><td>38000</td></tr> <tr><td>james</td><td>e</td><td>borg</td><td>55000</td></tr> </table> </body> </html> Prof. Dr. Dietmar Seipel 845

10 A servlet should check the parameters before using them in SQL queries. Database Injection Problem If we build the query as String query = "SELECT * FROM employee " + "WHERE salary >= " + Salary; then a user could enter 30000; DELETE * FROM employee in the field for salary of the HTML formular. Then the query SELECT * FROM employee WHERE salary >= 30000; DELETE * FROM employee would be constructed; its execution would delete all tuples of the relation employee. Prof. Dr. Dietmar Seipel 846

11 HTML Page with Servlet Calls <html> <head><title>employees over a given Income</title></head> <body> <h1>employees over a given Income</h1> <ul> <li> <a href=".../servlets/employeesalary?salary=0"> list all employess </a> </li> <li> <a href=".../servlets/employeesalary?salary=30000"> list employess over USD </a> </li> <li> <a href=".../servlets/employeesalary?salary=60000"> list employess over USD </a> </li> </ul> </body> </html> Prof. Dr. Dietmar Seipel 847

12 Prof. Dr. Dietmar Seipel 848

13 Access to Web Databases by Java Applets Applets are Java programs which are executed at the client side. Applets are mobile code, which is transferred from the Web server to the client, and which is executed at the client side. Prof. Dr. Dietmar Seipel 849

14 7.2 Java Server Pages HTML pages which consist of both static and dynamically generated parts Java Server Pages (JSPs) allow for embedding Java code fragments in an HTML page. The Web server initiates their execution before the page is send to the client. Advantage: The visualisation, i.e., the HTML code, is statically part of the document. The Java code fragments can be components (Java beans) that are part of separate files. This encreases readability and reuse. Microsoft alternatively offers Active Server Pages (ASPs). Prof. Dr. Dietmar Seipel 850

15 5 additional tags: attributes of the directive%> guiding the translation of the JSP by various attributes <%!declaration%> e.g., a Java operation which later is executed in the page several times <%=expression%> corresponds to <% out.print(expression) %> <%java code fragment%> <%--comment--%> is not transferred to the generated HTML document Prof. Dr. Dietmar Seipel 851

16 Java Server Page with Java Code import="java.sql.*"%> <%!Connection con = null;%> <%initconnection();%> <%!String generatehtmltable(string Salary)...%> <html> <head><title>employees over a given Income</title></head> <body> <ul> <li> 0 <%=generatehtmltable("0")%> </li> <li> <%=generatehtmltable("30000")%> </li> <li> <%=generatehtmltable("60000")%> </li> </ul> </body> </html> Prof. Dr. Dietmar Seipel 852

17 String generatehtmltable(string Salary) { StringBuffer result = new StringBuffer(); result.append("<table>"); try { String query = "SELECT * FROM employee " + "WHERE salary >= " + Salary + " "; Statement stmt = con.createstatement(); ResultSet rs = stmt.executequery(query); while (rs.next()) { result.append( "<tr><td>" + rs.getstring("fname") + "</td><td>" + rs.getstring("minit") + "</td><td>" + rs.getstring("lname") + "</td><td>" + rs.getstring("salary") + "</td></tr>" ); } } catch (Exception mye){ result.append(mye.tostring()); } result.append("</table>"); return result.tostring(); } Prof. Dr. Dietmar Seipel 853

18 Computation in PROLOG / FNQuery The relational database is accessed using an ODBC query. The data types of the returned rows of the table employee are given by Types. generate_html_table(salary, table:rows) :- concat( SELECT fname, minit, lname, salary \ FROM employee WHERE salary >=, Salary, Query), Types = [types([atom,atom,atom,integer])], findall( Row, ( odbc_query(mysql, Query, row(f,m,l,s), Types), Row = tr:[td:[f], td:[m], td:[l], td:[s]] ), Rows ). For a every result row(f,m,l,s), a PROLOG term tr:[td:[f], td:[m], td:[l], td:[s]] is constructed, which represents a table row in HTML. Prof. Dr. Dietmar Seipel 854

19 Java Server Page with a Call to a Java Bean <%@page import="jspdemo.employeebean"%> <jsp:usebean id="mybean" class="jspdemo.employeebean" scope="application"/> <html> <head><title>employees over a given Income</title></head> <body> <ul> <li> 0 <%=mybean.generatehtmltable("0")%> </li> <li> <%=mybean.generatehtmltable("30000")%> </li> <li> <%=mybean.generatehtmltable("60000")%> </li> </ul> </body> </html> Prof. Dr. Dietmar Seipel 855

20 Java Bean package jspdemo; import java.sql.*; public class EmployeeBean { Connection con = null; public EmployeeBean() { initconnection(); } public String generatehtmltable(string Salary)... } There must exist a constructor without parameters. Prof. Dr. Dietmar Seipel 856

21 Access to a JSP The JSP is translated into a servlet. The browser requests the JSP. The Web server initiates the execution of the generated servlet. During the execution, the Java code fragments (including the tags for the expressions) are eliminated, and they are replaced by the results that are generated during the execution. The resulting pure HTML page is send to the client. The Web browser displays this page. Prof. Dr. Dietmar Seipel 857

22 A Template Implementation in PROLOG (cf. Server Faces) <html> <head><title>employees earning at least USD</title></head> <body> <table border="1" cellpadding="5"> <tr> <th BGCOLOR="#dfdfff">Fname</th> <th BGCOLOR="#dfdfff">Minit</th> <th BGCOLOR="#dfdfff">Lname</th> <th BGCOLOR="#dfdfff">Salary</th> </tr> <sequence database="company" sql="where salary >= order by salary"> <tr> <td><select table="employee" attribute="fname"/></td> <td><select table="employee" attribute="minit"/></td> <td><select table="employee" attribute="lname"/></td> <td><select table="employee" attribute="salary"/></td> </tr> </table> </body> </html> Prof. Dr. Dietmar Seipel 858

23 7.3 Web Database Connections in PHP originally, PHP was designed as a scripting language, for generating HTML functional language, since PHP Version 4 also object oriented very broad support of the providers (classical environment: Apache / PHP 4 or PHP 5 / MySQL) lower costs for development and maintenance than for servlet applications Prof. Dr. Dietmar Seipel 859

24 databases can be accessed from PHP in two ways: directly over the PHP interface implementation of the database (e.g., php mysql) over the PEAR database interface (PHP Extension and Application Repository) PEAR serves as a layer of abstraction in PHP and supports (almost) all common database types, including MySQL, PostgreSQL, Oracle 7/8/8i, Interbase, ODBC, Microsoft SQL,... Prof. Dr. Dietmar Seipel 860

25 PEAR Database Model as an Abstraction Layer: Advantage: independent of database specific extensions (cf., ODBC), thus easily portable (e.g., from Mysql to Postgres) Disadvantage: no database specific features (e.g., view mechanisms under Postgres) Example (PEAR) Start of a connection over DSN (data source names): mysql://user:very_secret@localhost/company Query Shutdown of the connection Prof. Dr. Dietmar Seipel 861

26 <?php require_once( DB.php ); // $dsn = array( phptype => mysql, username => user, password => very_secret, hostspec => localhost, database => company ); $db =& DB::connect($dsn); if(pear::iserror($db)){ die($db->getmessage()); } $sql = "SELECT * FROM employee"; $result =& $db->query($sql); if(pear::iserror($result)){ die($result->getmessage()); } while($result->fetchinto($row)){ // $row: Array of result data } $db->disconnect();?> Prof. Dr. Dietmar Seipel 862

27 same example (Java like): <?php... $db = new DB(); $connection = $db->connect($dsn); if(pear::iserror($connection)){ die($connection->getmessage()); }... $result = $connection->query($sql);... while($row = $result->fetchrow()){ //... } $connection->disconnect();?> Prof. Dr. Dietmar Seipel 863

28 prepare and execute Statements for Select Queries standard query: $result = $db->query( "SELECT * FROM employee WHERE SALARY >= 30000"); prepared query with scalar: $prepared = $db->prepare( "SELECT * FROM employee WHERE SALARY >=?"); $result = $db->execute($prepared, 30000); prepared query with arrays: $prepared = $db->prepare( "SELECT * FROM employee WHERE SALARY >=? AND SEX =? "); $result = $db->execute($prepared, array(30000, F )); prepared statement for several queries: $prepared = $db->prepare( "SELECT * FROM employee WHERE SALARY >=? AND SEX =? "); $data = array(array(30000, F ), array(30000, M )); $results = $db->executemultiple($prepared, $data); foreach ($results as $result){ //... } Prof. Dr. Dietmar Seipel 864

29 autoprepare and autoexecute for Insert/Update Queries autoprepare generates complete Update or Insert Statements, which are executed using execute later autoexecute generates and executes Update or Insert Statements the query mode is set by DB_AUTOQUERY_INSERT and DB_AUTOQUERY_UPDATE, respectively Prof. Dr. Dietmar Seipel 865

30 Example (SQL, PHP): John Smith gets a raise in salary UPDATE employee SET SALARY=40000 WHERE SSN = ; <?php $field_values = array( SALARY => 40000); $result = $db->autoexecute( employee, // table $field_values, // Werte DB_AUTOQUERY_UPDATE, // Mode "SSN= " // WHERE--Bedingung ); // or: $field_names = array( SALARY ); $field_values = array( ); $prepared = $db->autoprepare( employee, $field_names, DB_AUTOQUERY_UPDATE, "SSN = "); $result =& $db->execute($prepared, $field_values);?> Prof. Dr. Dietmar Seipel 866

31 Result Sets of Queries: Arrays The result sets can be stored as indexed arrays: <?php while($row = $result->fetchrow()){ // $row indexed }?> associative arrays (the array index uses the DB columns): <?php $db->setfetchmode(db_fetchmode_assoc); while($row = $result->fetchrow()){ echo $row[ FNAME ]; echo $row[ LNAME ]; echo $row[ SEX ]; echo $row[ SALARY ]; }?> Prof. Dr. Dietmar Seipel 867

32 Literature Rasmus Lerdorf, Kevin Tatroe: Programming PHP, O Reilly Verlag, PEAR Online Manual: Prof. Dr. Dietmar Seipel 868

An introduction to web programming with Java

An introduction to web programming with Java Chapter 1 An introduction to web programming with Java Objectives Knowledge Objectives (continued) The first page of a shopping cart application The second page of a shopping cart application Components

More information

Precondition for a good understanding: knowledge of a higher programming language (e.g. C, Java, Perl, Pascal, Basic,... ) basic knowledge of html

Precondition for a good understanding: knowledge of a higher programming language (e.g. C, Java, Perl, Pascal, Basic,... ) basic knowledge of html Some Remarks about Dynamic Webpages Matthias K. Krause Hochschule für Telekommunikation, Leipzig University of Applied Sciences Deutsche Telekom krause@hft-leipzig.de Precondition for a good understanding:

More information

2. Follow the installation directions and install the server on ccc

2. Follow the installation directions and install the server on ccc Installing a Web Server 1. Install a sample web server, which supports Servlets/JSPs. A light weight web server is Apache Tomcat server. You can get the server from http://tomcat.apache.org/ 2. Follow

More information

Web Container Components Servlet JSP Tag Libraries

Web Container Components Servlet JSP Tag Libraries Web Application Development, Best Practices by Jeff Zhuk, JavaSchool.com ITS, Inc. dean@javaschool.com Web Container Components Servlet JSP Tag Libraries Servlet Standard Java class to handle an HTTP request

More information

15-415 Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System

15-415 Database Applications Recitation 10. Project 3: CMUQFlix CMUQ s Movies Recommendation System 15-415 Database Applications Recitation 10 Project 3: CMUQFlix CMUQ s Movies Recommendation System Project Objective 1. Set up a front-end website with PostgreSQL back-end 2. Allow users to login, like

More information

Database Access from a Programming Language: Database Access from a Programming Language

Database Access from a Programming Language: Database Access from a Programming Language Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

Database Access from a Programming Language:

Database Access from a Programming Language: Database Access from a Programming Language: Java s JDBC Werner Nutt Introduction to Databases Free University of Bozen-Bolzano 2 Database Access from a Programming Language Two Approaches 1. Embedding

More information

Java Server Pages and Java Beans

Java Server Pages and Java Beans Java Server Pages and Java Beans Java server pages (JSP) and Java beans work together to create a web application. Java server pages are html pages that also contain regular Java code, which is included

More information

INTRODUCTION TO WEB TECHNOLOGY

INTRODUCTION TO WEB TECHNOLOGY UNIT-I Introduction to Web Technologies: Introduction to web servers like Apache1.1, IIS, XAMPP (Bundle Server), WAMP Server(Bundle Server), handling HTTP Request and Response, installation of above servers

More information

ACM Crossroads Student Magazine The ACM's First Electronic Publication

ACM Crossroads Student Magazine The ACM's First Electronic Publication Page 1 of 8 ACM Crossroads Student Magazine The ACM's First Electronic Publication Crossroads Home Join the ACM! Search Crossroads crossroads@acm.org ACM / Crossroads / Columns / Connector / An Introduction

More information

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java

Java EE Introduction, Content. Component Architecture: Why and How Java EE: Enterprise Java Java EE Introduction, Content Component Architecture: Why and How Java EE: Enterprise Java The Three-Tier Model The three -tier architecture allows to maintain state information, to improve performance,

More information

Database System Concepts

Database System Concepts Chapter 8(+4): Application Design and Development APIs Web Departamento de Engenharia Informática Instituto Superior Técnico 1 st Semester 2010/2011 Slides (fortemente) baseados nos slides oficiais do

More information

Web Programming: Announcements. Sara Sprenkle August 3, 2006. August 3, 2006. Assignment 6 due today Project 2 due next Wednesday Review XML

Web Programming: Announcements. Sara Sprenkle August 3, 2006. August 3, 2006. Assignment 6 due today Project 2 due next Wednesday Review XML Web Programming: Java Servlets and JSPs Sara Sprenkle Announcements Assignment 6 due today Project 2 due next Wednesday Review XML Sara Sprenkle - CISC370 2 1 Web Programming Client Network Server Web

More information

Announcements. Comments on project proposals will go out by email in next couple of days...

Announcements. Comments on project proposals will go out by email in next couple of days... Announcements Comments on project proposals will go out by email in next couple of days... 3-Tier Using TP Monitor client application TP monitor interface (API, presentation, authentication) transaction

More information

Creating Java EE Applications and Servlets with IntelliJ IDEA

Creating Java EE Applications and Servlets with IntelliJ IDEA Creating Java EE Applications and Servlets with IntelliJ IDEA In this tutorial you will: 1. Create IntelliJ IDEA project for Java EE application 2. Create Servlet 3. Deploy the application to JBoss server

More information

Servlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun

Servlets. Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun Servlets Based on Notes by Dave Hollinger & Ethan Cerami Also, the Online Java Tutorial by Sun 1 What is a Servlet? A Servlet is a Java program that extends the capabilities of servers. Inherently multi-threaded.

More information

Writing Scripts with PHP s PEAR DB Module

Writing Scripts with PHP s PEAR DB Module Writing Scripts with PHP s PEAR DB Module Paul DuBois paul@kitebird.com Document revision: 1.02 Last update: 2005-12-30 As a web programming language, one of PHP s strengths traditionally has been to make

More information

Web Application Development on a Linux System With a DB2 Database By Alan Andrea

Web Application Development on a Linux System With a DB2 Database By Alan Andrea Web Application Development on a Linux System With a DB2 Database By Alan Andrea Linux, for a long time now, has been a robust and solid platform for deploying and developing complex applications. Furthermore,

More information

Advanced Object Oriented Database access using PDO. Marcus Börger

Advanced Object Oriented Database access using PDO. Marcus Börger Advanced Object Oriented Database access using PDO Marcus Börger ApacheCon EU 2005 Marcus Börger Advanced Object Oriented Database access using PDO 2 Intro PHP and Databases PHP 5 and PDO Marcus Börger

More information

J2EE Web Development. Agenda. Application servers. What is J2EE? Main component types Application Scenarios J2EE APIs and Services.

J2EE Web Development. Agenda. Application servers. What is J2EE? Main component types Application Scenarios J2EE APIs and Services. J2EE Web Development Agenda Application servers What is J2EE? Main component types Application Scenarios J2EE APIs and Services Examples 1 1. Application Servers In the beginning, there was darkness and

More information

The Collaborative Information Portal and NASA s Mars Rover Mission

The Collaborative Information Portal and NASA s Mars Rover Mission The Collaborative Information Portal and NASA s Mars Rover Mission Bildquelle: Ronald Mak, University of California, Santa Cruz Joan Walton, NASA Ames Research Center Qualitative Anfoderungen Message-Service

More information

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn

Chapter 9 Java and SQL. Wang Yang wyang@njnet.edu.cn Chapter 9 Java and SQL Wang Yang wyang@njnet.edu.cn Outline Concern Data - File & IO vs. Database &SQL Database & SQL How Connect Java to SQL - Java Model for Database Java Database Connectivity (JDBC)

More information

Web development... the server side (of the force)

Web development... the server side (of the force) Web development... the server side (of the force) Fabien POULARD Document under license Creative Commons Attribution Share Alike 2.5 http://www.creativecommons.org/learnmore Web development... the server

More information

Supplement IV.E: Tutorial for Tomcat. For Introduction to Java Programming By Y. Daniel Liang

Supplement IV.E: Tutorial for Tomcat. For Introduction to Java Programming By Y. Daniel Liang Supplement IV.E: Tutorial for Tomcat For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Obtaining and Installing Tomcat Starting and Stopping Tomcat Choosing

More information

DBMS Project. COP5725 - Spring 2011. Final Submission Report

DBMS Project. COP5725 - Spring 2011. Final Submission Report DBMS Project COP5725 - Spring 2011 Final Submission Report Chandra Shekar # 6610-6717 Nitin Gujral # 4149-1481 Rajesh Sindhu # 4831-2035 Shrirama Tejasvi # 7521-6735 LINK TO PROJECT Project Website : www.cise.ufl.edu/~mallela

More information

Glassfish, JAVA EE, Servlets, JSP, EJB

Glassfish, JAVA EE, Servlets, JSP, EJB Glassfish, JAVA EE, Servlets, JSP, EJB Java platform A Java platform comprises the JVM together with supporting class libraries. Java 2 Standard Edition (J2SE) (1999) provides core libraries for data structures,

More information

Agenda. Summary of Previous Session. Application Servers G22.3033-011. Session 3 - Main Theme Page-Based Application Servers (Part II)

Agenda. Summary of Previous Session. Application Servers G22.3033-011. Session 3 - Main Theme Page-Based Application Servers (Part II) Application Servers G22.3033-011 Session 3 - Main Theme Page-Based Application Servers (Part II) Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical

More information

Applets, RMI, JDBC Exam Review

Applets, RMI, JDBC Exam Review Applets, RMI, JDBC Exam Review Sara Sprenkle Announcements Quiz today Project 2 due tomorrow Exam on Thursday Web programming CPM and servlets vs JSPs Sara Sprenkle - CISC370 2 1 Division of Labor Java

More information

Client-server 3-tier N-tier

Client-server 3-tier N-tier Web Application Design Notes Jeff Offutt http://www.cs.gmu.edu/~offutt/ SWE 642 Software Engineering for the World Wide Web N-Tier Architecture network middleware middleware Client Web Server Application

More information

Building Web Applications, Servlets, JSP and JDBC

Building Web Applications, Servlets, JSP and JDBC Building Web Applications, Servlets, JSP and JDBC Overview Java 2 Enterprise Edition (JEE) is a powerful platform for building web applications. The JEE platform offers all the advantages of developing

More information

Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE

Web Programming II JSP (Java Server Pages) ASP request processing. The Problem. The Problem. Enterprise Application Development using J2EE Enterprise Application Development using J2EE Shmulik London Lecture #6 Web Programming II JSP (Java Server Pages) How we approached it in the old days (ASP) Multiplication Table Multiplication

More information

Introduction to J2EE Web Technologies

Introduction to J2EE Web Technologies Introduction to J2EE Web Technologies Kyle Brown Senior Technical Staff Member IBM WebSphere Services RTP, NC brownkyl@us.ibm.com Overview What is J2EE? What are Servlets? What are JSP's? How do you use

More information

Form Handling. Server-side Web Development and Programming. Form Handling. Server Page Model. Form data appended to request string

Form Handling. Server-side Web Development and Programming. Form Handling. Server Page Model. Form data appended to request string Form Handling Server-side Web Development and Programming Lecture 3: Introduction to Java Server Pages Form data appended to request string

More information

2.8. Session management

2.8. Session management 2.8. Session management Juan M. Gimeno, Josep M. Ribó January, 2008 Session management. Contents Motivation Hidden fields URL rewriting Cookies Session management with the Servlet/JSP API Examples Scopes

More information

Building Web Applications with Servlets and JavaServer Pages

Building Web Applications with Servlets and JavaServer Pages Building Web Applications with Servlets and JavaServer Pages David Janzen Assistant Professor of Computer Science Bethel College North Newton, KS http://www.bethelks.edu/djanzen djanzen@bethelks.edu Acknowledgments

More information

Real SQL Programming 1

Real SQL Programming 1 Real 1 We have seen only how SQL is used at the generic query interface an environment where we sit at a terminal and ask queries of a database. Reality is almost always different: conventional programs

More information

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk

www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 www.virtualians.pk CS506 Web Design and Development Solved Online Quiz No. 01 Which of the following is a general purpose container? JFrame Dialog JPanel JApplet Which of the following package needs to be import while handling

More information

Building Java Servlets with Oracle JDeveloper

Building Java Servlets with Oracle JDeveloper Building Java Servlets with Oracle JDeveloper Chris Schalk Oracle Corporation Introduction Developers today face a formidable task. They need to create large, distributed business applications. The actual

More information

Course Number: IAC-SOFT-WDAD Web Design and Application Development

Course Number: IAC-SOFT-WDAD Web Design and Application Development Course Number: IAC-SOFT-WDAD Web Design and Application Development Session 1 (10 Hours) Client Side Scripting Session 2 (10 Hours) Server Side Scripting - I Session 3 (10 hours) Database Session 4 (10

More information

Specialized Programme on Web Application Development using Open Source Tools

Specialized Programme on Web Application Development using Open Source Tools Specialized Programme on Web Application Development using Open Source Tools A. NAME OF INSTITUTE Centre For Development of Advanced Computing B. NAME/TITLE OF THE COURSE C. COURSE DATES WITH DURATION

More information

Short notes on webpage programming languages

Short notes on webpage programming languages Short notes on webpage programming languages What is HTML? HTML is a language for describing web pages. HTML stands for Hyper Text Markup Language HTML is a markup language A markup language is a set of

More information

Principles and Techniques of DBMS 5 Servlet

Principles and Techniques of DBMS 5 Servlet Principles and Techniques of DBMS 5 Servlet Haopeng Chen REliable, INtelligentand Scalable Systems Group (REINS) Shanghai Jiao Tong University Shanghai, China http://reins.se.sjtu.edu.cn/~chenhp e- mail:

More information

Web Programming with Java Servlets

Web Programming with Java Servlets Web Programming with Java Servlets Leonidas Fegaras University of Texas at Arlington Web Data Management and XML L3: Web Programming with Servlets 1 Database Connectivity with JDBC The JDBC API makes it

More information

The JAVA Way: JDBC and SQLJ

The JAVA Way: JDBC and SQLJ The JAVA Way: JDBC and SQLJ David Toman School of Computer Science University of Waterloo Introduction to Databases CS348 David Toman (University of Waterloo) JDBC/SQLJ 1 / 21 The JAVA way to Access RDBMS

More information

Customer Bank Account Management System Technical Specification Document

Customer Bank Account Management System Technical Specification Document Customer Bank Account Management System Technical Specification Document Technical Specification Document Page 1 of 15 Table of Contents Contents 1 Introduction 3 2 Design Overview 4 3 Topology Diagram.6

More information

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC?

What is ODBC? Database Connectivity ODBC, JDBC and SQLJ. ODBC Architecture. More on ODBC. JDBC vs ODBC. What is JDBC? What is ODBC? Database Connectivity ODBC, JDBC and SQLJ CS2312 ODBC is (Open Database Connectivity): A standard or open application programming interface (API) for accessing a database. SQL Access Group,

More information

MULTICULTURAL CONTENT MANAGEMENT SYSTEM

MULTICULTURAL CONTENT MANAGEMENT SYSTEM MULTICULTURAL CONTENT MANAGEMENT SYSTEM AT A GLANCE Language Partner s Multilingual Content Management System Meridium is multilingual content management system designed to fast track the process of multilingual

More information

Other Language Types CMSC 330: Organization of Programming Languages

Other Language Types CMSC 330: Organization of Programming Languages Other Language Types CMSC 330: Organization of Programming Languages Markup and Query Languages Markup languages Set of annotations to text Query languages Make queries to databases & information systems

More information

Implementing the Shop with EJB

Implementing the Shop with EJB Exercise 2 Implementing the Shop with EJB 2.1 Overview This exercise is a hands-on exercise in Enterprise JavaBeans (EJB). The exercise is as similar as possible to the other exercises (in other technologies).

More information

Zend Framework Database Access

Zend Framework Database Access Zend Framework Database Access Bill Karwin Copyright 2007, Zend Technologies Inc. Introduction What s in the Zend_Db component? Examples of using each class Using Zend_Db in MVC applications Zend Framework

More information

Pure server-side Web Applications with Java, JSP. Application Servers: the Essential Tool of Server-Side Programming. Install and Check Tomcat

Pure server-side Web Applications with Java, JSP. Application Servers: the Essential Tool of Server-Side Programming. Install and Check Tomcat Pure server-side Web Applications with Java, JSP Discussion of networklevel http requests and responses Using the Java programming language (Java servlets and JSPs) Key lesson: The role of application

More information

Specialized Programme on Web Application Development using Open Source Tools

Specialized Programme on Web Application Development using Open Source Tools Specialized Programme on Web Application Development using Open Source Tools Objective: At the end of the course, Students will be able to: Understand various open source tools(programming tools and databases)

More information

Development of Web Applications

Development of Web Applications Development of Web Applications Principles and Practice Vincent Simonet, 2013-2014 Université Pierre et Marie Curie, Master Informatique, Spécialité STL 3 Server Technologies Vincent Simonet, 2013-2014

More information

Java Application Developer Certificate Program Competencies

Java Application Developer Certificate Program Competencies Java Application Developer Certificate Program Competencies After completing the following units, you will be able to: Basic Programming Logic Explain the steps involved in the program development cycle

More information

Class Focus: Web Applications that provide Dynamic Content

Class Focus: Web Applications that provide Dynamic Content Class Focus: Web Applications that provide Dynamic Content We will learn how to build server-side applications that interact with their users and provide dynamic content Using the Java programming language

More information

Usability. Usability

Usability. Usability Objectives Review Usability Web Application Characteristics Review Servlets Deployment Sessions, Cookies Usability Trunk Test Harder than you probably thought Your answers didn t always agree Important

More information

How To Test A Web Database Application

How To Test A Web Database Application Testing Web Database Applications Yuetang Deng Phyllis Frankl Jiong Wang Department of Computer and Information Science Technical Report TR -CIS-2004-01 04/28/2004 Testing Web Database Applications Yuetang

More information

Software Architecture

Software Architecture Software Architecture Definitions http://www.sei.cmu.edu/architecture/published_definiti ons.html ANSI/IEEE Std 1471-2000, Recommended Practice for Architectural Description of Software- Intensive Systems

More information

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline

Outline. CS 112 Introduction to Programming. Recap: HTML/CSS/Javascript. Admin. Outline Outline CS 112 Introduction to Programming Web Programming: Backend (server side) Programming with Servlet, JSP q Admin and recap q Server-side web programming overview q Servlet programming q Java servlet

More information

Introduction to Web Technologies

Introduction to Web Technologies Secure Web Development Teaching Modules 1 Introduction to Web Technologies Contents 1 Concepts... 1 1.1 Web Architecture... 2 1.2 Uniform Resource Locators (URL)... 3 1.3 HTML Basics... 4 1.4 HTTP Protocol...

More information

COSC344 Database Theory and Applications. Java and SQL. Lecture 12

COSC344 Database Theory and Applications. Java and SQL. Lecture 12 COSC344 Database Theory and Applications Lecture 12: Java and SQL COSC344 Lecture 12 1 Last Lecture Trigger Overview This Lecture Java & SQL Source: Lecture notes, Textbook: Chapter 12 JDBC documentation

More information

DIPLOMA IN WEBDEVELOPMENT

DIPLOMA IN WEBDEVELOPMENT DIPLOMA IN WEBDEVELOPMENT Prerequisite skills Basic programming knowledge on C Language or Core Java is must. # Module 1 Basics and introduction to HTML Basic HTML training. Different HTML elements, tags

More information

PHP Skills and Techniques

PHP Skills and Techniques PHP Hypertext Pre-Processor Currently Version 4 The Server Side Scripting Technology http://www.php.net PHP Overview About My Person Introduction to PHP History of PHP Dynamic Web Contents -> Server Side

More information

How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post

How To Understand The Architecture Of Java 2Ee, J2Ee, And J2E (Java) In A Wordpress Blog Post Understanding Architecture and Framework of J2EE using Web Application Devadrita Dey Sarkar,Anavi jaiswal, Ankur Saxena Amity University,UTTAR PRADESH Sector-125, Noida, UP-201303, India Abstract: This

More information

Brazil + JDBC Juin 2001, douin@cnam.fr http://jfod.cnam.fr/tp_cdi/douin/

Brazil + JDBC Juin 2001, douin@cnam.fr http://jfod.cnam.fr/tp_cdi/douin/ Brazil + JDBC Juin 2001, douin@cnam.fr http://jfod.cnam.fr/tp_cdi/douin/ version du 26 Mai 2003 : JDBC-SQL et Brazil pré-requis : lecture de Tutorial JDBC de Sun Bibliographie Brazil [Bra00]www.sun.com/research/brazil

More information

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford

Database Programming. Week 10-2. *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford Database Programming Week 10-2 *Some of the slides in this lecture are created by Prof. Ian Horrocks from University of Oxford SQL in Real Programs We have seen only how SQL is used at the generic query

More information

UQC103S1 UFCE47-20-1. Systems Development. uqc103s/ufce47-20-1 PHP-mySQL 1

UQC103S1 UFCE47-20-1. Systems Development. uqc103s/ufce47-20-1 PHP-mySQL 1 UQC103S1 UFCE47-20-1 Systems Development uqc103s/ufce47-20-1 PHP-mySQL 1 Who? Email: uqc103s1@uwe.ac.uk Web Site www.cems.uwe.ac.uk/~jedawson www.cems.uwe.ac.uk/~jtwebb/uqc103s1/ uqc103s/ufce47-20-1 PHP-mySQL

More information

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology kamandi@ce.sharif.edu Fall 2007

Internet Engineering: Web Application Architecture. Ali Kamandi Sharif University of Technology kamandi@ce.sharif.edu Fall 2007 Internet Engineering: Web Application Architecture Ali Kamandi Sharif University of Technology kamandi@ce.sharif.edu Fall 2007 Centralized Architecture mainframe terminals terminals 2 Two Tier Application

More information

DATABASDESIGN FÖR INGENJÖRER - 1DL124

DATABASDESIGN FÖR INGENJÖRER - 1DL124 1 DATABASDESIGN FÖR INGENJÖRER - 1DL124 Sommar 2007 En introduktionskurs i databassystem http://user.it.uu.se/~udbl/dbt-sommar07/ alt. http://www.it.uu.se/edu/course/homepage/dbdesign/st07/ Kjell Orsborn

More information

PA165 - Lab session - Web Presentation Layer

PA165 - Lab session - Web Presentation Layer PA165 - Lab session - Web Presentation Layer Author: Martin Kuba Goal Experiment with basic building blocks of Java server side web technology servlets, filters, context listeners,

More information

Modeling Presentation Layers of Web Applications for Testing

Modeling Presentation Layers of Web Applications for Testing Modeling Presentation Layers of Web Applications for Testing Jeff Offutt Software Engineering Volgenau School of Information Technology and Engineering George Mason University Fairfax, VA 22030, USA offutt@gmu.edu

More information

CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, 2004. Java Servlets

CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, 2004. Java Servlets CSc31800: Internet Programming, CS-CCNY, Spring 2004 Jinzhong Niu May 9, 2004 Java Servlets I have presented a Java servlet example before to give you a sense of what a servlet looks like. From the example,

More information

Connecting to a Database Using PHP. Prof. Jim Whitehead CMPS 183, Spring 2006 May 15, 2006

Connecting to a Database Using PHP. Prof. Jim Whitehead CMPS 183, Spring 2006 May 15, 2006 Connecting to a Database Using PHP Prof. Jim Whitehead CMPS 183, Spring 2006 May 15, 2006 Rationale Most Web applications: Retrieve information from a database to alter their on-screen display Store user

More information

Security Code Review- Identifying Web Vulnerabilities

Security Code Review- Identifying Web Vulnerabilities Security Code Review- Identifying Web Vulnerabilities Kiran Maraju, CISSP, CEH, ITIL, SCJP Email: Kiran_maraju@yahoo.com 1 1.1.1 Abstract Security Code Review- Identifying Web Vulnerabilities This paper

More information

Final Design Document for Practicum Chat Program

Final Design Document for Practicum Chat Program Final Design Document for Practicum Chat Program Prepared by: Team Members: Raymond Chamberglain William Mason Jerrad Allen Elh Barry Franklin University CS Practicum April 12, 2008 Page 1 Purpose: This

More information

Application note: SQL@CHIP Connecting the IPC@CHIP to a Database

Application note: SQL@CHIP Connecting the IPC@CHIP to a Database Application note: SQL@CHIP Connecting the IPC@CHIP to a Database 1. Introduction This application note describes how to connect an IPC@CHIP to a database and exchange data between those. As there are no

More information

No no-argument constructor. No default constructor found

No no-argument constructor. No default constructor found Every software developer deals with bugs. The really tough bugs aren t detected by the compiler. Nasty bugs manifest themselves only when executed at runtime. Here is a list of the top ten difficult and

More information

WEB DATABASE PUBLISHING

WEB DATABASE PUBLISHING WEB DATABASE PUBLISHING 1. Basic concepts of WEB database publishing (WEBDBP) 2. WEBDBP structures 3. CGI concepts 4. Cold Fusion 5. API - concepts 6. Structure of Oracle Application Server 7. Listeners

More information

Virtual Open-Source Labs for Web Security Education

Virtual Open-Source Labs for Web Security Education , October 20-22, 2010, San Francisco, USA Virtual Open-Source Labs for Web Security Education Lixin Tao, Li-Chiou Chen, and Chienting Lin Abstract Web security education depends heavily on hands-on labs

More information

Tutorial: Building a Web Application with Struts

Tutorial: Building a Web Application with Struts Tutorial: Building a Web Application with Struts Tutorial: Building a Web Application with Struts This tutorial describes how OTN developers built a Web application for shop owners and customers of the

More information

Java 2 Web Developer Certification Study Guide Natalie Levi

Java 2 Web Developer Certification Study Guide Natalie Levi SYBEX Sample Chapter Java 2 Web Developer Certification Study Guide Natalie Levi Chapter 8: Thread-Safe Servlets Copyright 2002 SYBEX Inc., 1151 Marina Village Parkway, Alameda, CA 94501. World rights

More information

SQL and programming languages

SQL and programming languages SQL and programming languages SET08104 Database Systems Copyright Napier University Slide 1/14 Pure SQL Pure SQL: Queries typed at an SQL prompt. SQL is a non-procedural language. SQL specifies WHAT, not

More information

Performance and Usability Analysis of Varying Web Service Architectures

Performance and Usability Analysis of Varying Web Service Architectures Performance and Usability Analysis of Varying Web Service Architectures Abstract Michael Lenner Department of Computer Science Columbia University mml2108@cs.columbia.edu We tested the performance of four

More information

DTS Web Developers Guide

DTS Web Developers Guide Apelon, Inc. Suite 202, 100 Danbury Road Ridgefield, CT 06877 Phone: (203) 431-2530 Fax: (203) 431-2523 www.apelon.com Apelon Distributed Terminology System (DTS) DTS Web Developers Guide Table of Contents

More information

FileMaker Server 12. Custom Web Publishing with PHP

FileMaker Server 12. Custom Web Publishing with PHP FileMaker Server 12 Custom Web Publishing with PHP 2007 2012 FileMaker, Inc. All Rights Reserved. FileMaker, Inc. 5201 Patrick Henry Drive Santa Clara, California 95054 FileMaker and Bento are trademarks

More information

A Brief Introduction to MySQL

A Brief Introduction to MySQL A Brief Introduction to MySQL by Derek Schuurman Introduction to Databases A database is a structured collection of logically related data. One common type of database is the relational database, a term

More information

DBX. SQL database extension for Splunk. Siegfried Puchbauer

DBX. SQL database extension for Splunk. Siegfried Puchbauer DBX SQL database extension for Splunk Siegfried Puchbauer Agenda Features Architecture Supported platforms Supported databases Roadmap Features Database connection management SQL database input (content

More information

Handling the Client Request: Form Data

Handling the Client Request: Form Data 2012 Marty Hall Handling the Client Request: Form Data Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/csajsp2.html 3 Customized Java EE Training: http://courses.coreservlets.com/

More information

AN OVERVIEW OF SERVLET AND JSP TECHNOLOGY

AN OVERVIEW OF SERVLET AND JSP TECHNOLOGY AN OVERVIEW OF SERVLET AND JSP TECHNOLOGY Topics in This Chapter Understanding the role of servlets Building Web pages dynamically Looking at servlet code Evaluating servlets vs. other technologies Understanding

More information

Package sjdbc. R topics documented: February 20, 2015

Package sjdbc. R topics documented: February 20, 2015 Package sjdbc February 20, 2015 Version 1.5.0-71 Title JDBC Driver Interface Author TIBCO Software Inc. Maintainer Stephen Kaluzny Provides a database-independent JDBC interface. License

More information

Example for Using the PrestaShop Web Service : CRUD

Example for Using the PrestaShop Web Service : CRUD Example for Using the PrestaShop Web Service : CRUD This tutorial shows you how to use the PrestaShop web service with PHP library by creating a "CRUD". Prerequisites: - PrestaShop 1.4 installed on a server

More information

SECURING APACHE : THE BASICS - III

SECURING APACHE : THE BASICS - III SECURING APACHE : THE BASICS - III Securing your applications learn how break-ins occur Shown in Figure 2 is a typical client-server Web architecture, which also indicates various attack vectors, or ways

More information

How To Use The Database In Jdbc.Com On A Microsoft Gdbdns.Com (Amd64) On A Pcode (Amd32) On An Ubuntu 8.2.2 (Amd66) On Microsoft

How To Use The Database In Jdbc.Com On A Microsoft Gdbdns.Com (Amd64) On A Pcode (Amd32) On An Ubuntu 8.2.2 (Amd66) On Microsoft CS 7700 Transaction Design for Microsoft Access Database with JDBC Purpose The purpose of this tutorial is to introduce the process of developing transactions for a Microsoft Access Database with Java

More information

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP

INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP INSTALLING, CONFIGURING, AND DEVELOPING WITH XAMPP by Dalibor D. Dvorski, March 2007 Skills Canada Ontario DISCLAIMER: A lot of care has been taken in the accuracy of information provided in this article,

More information

Syllabus INFO-UB-3322. Design and Development of Web and Mobile Applications (Especially for Start Ups)

Syllabus INFO-UB-3322. Design and Development of Web and Mobile Applications (Especially for Start Ups) Syllabus INFO-UB-3322 Design and Development of Web and Mobile Applications (Especially for Start Ups) Fall 2014 Stern School of Business Norman White, KMEC 8-88 Email: nwhite@stern.nyu.edu Phone: 212-998

More information

Apache Jakarta Tomcat

Apache Jakarta Tomcat Apache Jakarta Tomcat 20041058 Suh, Junho Road Map 1 Tomcat Overview What we need to make more dynamic web documents? Server that supports JSP, ASP, database etc We concentrates on Something that support

More information

COSC 304 Database Web Programming Overview Introduction to Database Systems Database Web Programming Dr. Ramon Lawrence

COSC 304 Database Web Programming Overview Introduction to Database Systems Database Web Programming Dr. Ramon Lawrence COSC 304 Introduction to Database Systems Database Web Programming Dr. Ramon Lawrence University of British Columbia Okanagan ramon.lawrence@ubc.ca Database Web Programming Overview Developing web-based

More information

Eclectic Computing. Time Tracking Tool Software Architecture Document. Version <1.3>

Eclectic Computing. Time Tracking Tool Software Architecture Document. Version <1.3> Eclectic Computing Time Tracking Tool Version Revision History Date Version Description Author 7/Mar/05 1.0 Documentation of high-level architecture. David Janzen 7/Apr/05 1.1 Architecture at end

More information

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012

CSI 2132 Lab 8. Outline. Web Programming JSP 23/03/2012 CSI 2132 Lab 8 Web Programming JSP 1 Outline Web Applications Model View Controller Architectures for Web Applications Creation of a JSP application using JEE as JDK, Apache Tomcat as Server and Netbeans

More information

J2EE-Application Server

J2EE-Application Server J2EE-Application Server (inkl windows-8) Installation-Guide F:\_Daten\Hochschule Zurich\Web-Technologie\ApplicationServerSetUp.docx Last Update: 19.3.2014, Walter Rothlin Seite 1 Table of Contents Java

More information