Java Server Pages and Java Beans
|
|
|
- Henry Craig
- 9 years ago
- Views:
Transcription
1 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 between special tags. Java beans are Java programs that follow some specific rules. Together they make up part of a web application. There are several advantages to using Java server pages and beans. One is that the html and the Java code can be kept separate. Another is that the JSP file is a special kind of html file so that it can be placed anywhere on the server and can include any html tags, including references to other pages, images, applets, etc. Java server pages are not only html pages. They are also Java programs, so they must be compiled. This is done the first time that they are accessed. After that, the compiled code resides on the server and can be used as is by any succeeding requests. They are first translated into Java servlets, and then the servlets are compiled into class files. On a stand-alone system, you can find both in the folder work/standalone/localhost/_. Java Server Pages In a JSP file the Java code is contained between tags that begin with <% and end with %>. These tags are also used in active server pages (asp). There are several different kinds of JSP tags depending upon their use. <%= %> is used for expressions. <%! %> is used for declarations. <% %> is used for straight Java code. <%@ %> is used to include another file such as an html file or a package such as java.sql.*. There are some reserved words that may be used by JSP files without further definition. These should be familiar from similar terms used with Java servlets. request an instance of HttpServletRequest. response an instance of HttpServletResponse. out a PrintWriter object for the response. session the HttpSession object associated with the session. Java Beans Java beans are regular Java programs with a few specific restrictions. The constructor may not have any parameters, and the variables all have get and set accessor and mutator methods. The Java server page uses the accessor and mutator methods of the bean to send values to the bean and to get resulting data back from the bean. In a Java bean, you can instantiate other classes, access databases, create lists, tables, and anything else you might want to do. You can also have methods that receive request data from the JSP file. They have the usual request parameter as in the following example: public void processrequest (HttpServletRequest request) } JSP files must declare which bean they are going to use. This is done with tags that follow xml syntax. They are case sensitive and must have closing tags or a closing /. A bean declaration for a simple hello world example follows: <jsp:usebean id = "hello" scope = "session" class = "greetings.hellobean" />
2 The id for the bean is used in place of a name. The declaration links it to the bean class, HelloBean.class. The Java server page may be located anywhere, but the class file goes in the same classes folder as the servlet classes. HelloBean Example The bean, HelloBean.java, is very simple. We will see more complicated beans later on. It doesn t have a separate constructor, only the default one without parameters. It also does not do anything other than provide a storage place for the data, the name and the address. Notice it is in a package called greetings. package greetings; public class HelloBean private String name = ""; private String = ""; public String getname() return name;} public String get () return ;} public void setname (String n) name = n;} public void set (String e) = e;} } // HelloBean The Java server page must also set the properties of the bean, i.e. the bean s instance data. This is done with jsp:setproperty tags. These too use xml syntax. <jsp:setproperty name="hello" property="name" value='<%= request.getparameter ("name") %>' /> <jsp:setproperty name="hello" property=" " value='<%= request.getparameter (" ") %>' /> The name attribute is the same as the bean id, hello. The property is the name of the instance variable in the bean. And the value is read from the html input data. The html page used for this example is also very simple. <head><title>hello</title></head> <body bgcolor="white"> <font size=5 color="blue"> <form method="get" action="hello.jsp"> <br />Enter your name and address: <br /><input type="text" name="name" value="" size="20"> Name <br /><input type="text" name=" " value="" size="20"> <p> <input type="submit" name="send" value="send"></p> </form> </font></body></html> The JSP file combines both html and Java code. One that can tie together the html and bean files above follows: <head><title>hello JSP</title></head>
3 <body bgcolor="white"> <font size=5 color="blue"> <%! String name, ; %> <jsp:usebean id="hello" scope="session" class="greetings.hellobean" /> <jsp:setproperty name="hello" property="name" value='<%= request.getparameter ("name") %>' /> <jsp:setproperty name="hello" property=" " value='<%= request.getparameter (" ") %>' /> <% name = hello.getname(); = hello.get (); %> Hello, your name is <% out.println (name); %> <br />And your address is <% out.println ( ); %> </font></body></html> The result looks like: Hello, your name is Alice Lee And your address is [email protected] where the request data sent by the html file was Alice Lee for the name and [email protected] for the address. The setproperty tags in the Java server page can be replaced by <jsp:setproperty name = "hello" property = "*" /> if the names in the JSP and bean files are the same. This doesn t always work, but in most cases it saves a lot of writing. However, when using this shortcut, there are several conventions that must be followed. First, the accessor and mutator methods must be of the form get () set (String e) where the identifier in the web page and bean is . If instead, the variable was called , the get and set methods would be get () set (String e) The first letter after the get or set must be capitalized. The rest of the letters follow the capitalization in the variable. This also means that all variables should begin with lower case letters. FindBean Example A somewhat more complicated example can be created to find an object in a database. The database access is done in the bean while the html display is created by the Java server page. The following shows a simple Access table.
4 A small html page can be used to find the product given the product s name. <head><title>find Product</title></head> <body bgcolor="white"> <form method="get" action="find.jsp"> <br> <font size=5 color="blue"> Enter the name of the product: <br> <input type="text" name="name" value="" size="20"> Name <br /> <br /> <input type="submit" name="action" value="send"> </font> </form> </body></html> In a browser, this looks like: Enter the name of the product: Apples Name Send
5 The Java server page, find.jsp, contains code to both use the bean, FindBean, and to display the results of the search. The bean is in a package called produce, so it is referred to as "produce.findbean". The bean id may be anything, but calling it FindBean makes it clear what bean is meant. The only method in FindBean other than gets and sets is called processrequest. It has no parameters. <head><title> Find Produce JSP. </title></head> <body bgcolor = "white"> <font size = "4" color="blue"> <jsp:usebean id = "findbean" scope = "session" class = "produce.findbean" /> <jsp:setproperty name = "findbean" property = "*" /> <% findbean.processrequest(); %> <% if (findbean.getfound ()) %> <h4>produce Table</h4> <table border = "1" cellspacing = "5"> <tr> <td><% out.println (findbean.getid()); %></td> <td><% out.println (findbean.gettype()); %></td> <td><% out.println (findbean.getname()); %></td> <td><% out.println (findbean.getvariety()); %></td> <td><% out.println (findbean.getprice()); %></td> </tr> </table> <% } else %> <h4>the product is not in the database.</h4> <% } %> <hr> <p><a href = "../market/find.html">return</a></p> </font> </body></html> If the product is in the database, the result is a table row with the results. But if the product was not found, an error message will be displayed. Produce Table The Return reference takes you back to find.html. AF136 Fruit Apples Red Delicious 1.25 Return
6 The Java bean, FindBean.java, is quite brief. It accesses the database and uses the results to set the values for the instance variables. package produce; import java.sql.*; import java.io.*; // FindBean locates the product in the database and gets values for the instance variables. public class FindBean private String id, type, name, variety, price; private boolean found; // The accessor methods. public String getid() return id;} public String gettype() return type;} public String getname() return name;} public String getvariety() return variety;} public String getprice() return price;} public boolean getfound () return found;} public void setname (String n) name = n;} // The only set method needed. public void processrequest () try // Get a jdbc-odbc bridge and connect to produce.mdb. Class.forName ("sun.jdbc.odbc.jdbcodbcdriver"); Connection con = DriverManager.getConnection ("jdbc:odbc:produce"); // Create a statement to query the database. Statement stmt = con.createstatement (); String query = "Select * From ProduceTable Where Name = '" + name + "'"; ResultSet rs = stmt.executequery (query); // If the result set is not empty, use the result set to get values for the instance variables. if (rs.next ()) id = rs.getstring ("ID"); type = rs.getstring ("Type"); name = rs.getstring ("Name"); variety = rs.getstring ("Variety"); price = rs.getstring ("Price"); found = true; } else found = false; } catch (ClassNotFoundException e)system.out.println ("Class Not Found exception.\n");} catch (SQLException e)system.out.println ("SQL Exception");} } // processrequest } // FindBean
7 Displaying the Database The result set that a Select query returns cannot be sent to the Java server page. But the data can be stored in a data structure such as an array, list or hashtable. The following example stores it as a two dimensional array where row 0 contains the column names and the data starts in row 1 column 1. This means that column 0 is never used. But that really doesn t matter. The Java bean for this application has to contact the database and then create the table. The table may then be used by the Java server page to display the data in an html table. The Java bean is shown first. DisplayBean.java // DisplayBean gets data from a database and creates a table containing the data. import java.sql.*; import java.io.*; import javax.servlet.http.*; // DisplayBean gets the data from the database and creates a table called tabledata. public class DisplayBean private String [][] tabledata; private int rows; private int columns; private Connection con; public String [][] gettabledata () return tabledata;} public int getrows () return rows;} public int getcolumns () return columns;} public void settabledata (String [][] t) tabledata = t;} public void setrows (int r) rows = r;} public void setcols (int c) columns = c;} public void processrequest () try // Get a jdbc-odbc bridge and connect to produce.mdb. Class.forName ("sun.jdbc.odbc.jdbcodbcdriver"); con = DriverManager.getConnection ("jdbc:odbc:produce"); // Create a statement to query the database. Statement stmt = con.createstatement (); String query = "Select * From ProduceTable"; ResultSet rs = stmt.executequery (query); ResultSetMetaData metadata = rs.getmetadata (); columns = metadata.getcolumncount ();
8 // Get a new instance of the table and fill it. tabledata = new String [20][columns+1]; for (int count = 1; count <= columns; count ++) tabledata [0][count] = metadata.getcolumnname (count); rows = 1; while (rs.next ()) for (int col = 1; col<= columns; col ++) tabledata [rows][col] = rs.getstring (col); rows ++; } con.close (); } catch (ClassNotFoundException e)system.out.println ("Class Not Found exception.\n");} catch (SQLException e)system.out.println ("SQL Exception\n");} } // processrequest } // class DisplayBean The Java server page receives the table and uses it to display the results on an html page. display.jsp <head><title> Display Products JSP. </title></head> <body bgcolor="white"> <font size=4 color="blue"> <%! String [][] tabledata; int rows, columns, row, col; %> <jsp:usebean id="displaybean" scope="session" class="produce.displaybean" /> <jsp:setproperty name="displaybean" property="*" /> <% displaybean.processrequest(); %> <h4>produce Table</h4> <% %> tabledata = displaybean.gettabledata (); rows = displaybean.getrows (); columns = displaybean.getcolumns (); <table border='1' bordercolor='blue' cellspacing='10'> <% for (int row = 0; row < rows; row ++) %> <tr> <% for (int col = 1; col <= columns; col ++) %> <td> <% out.println (tabledata [row][col]); %></td> <% } %> </tr> <% } %> </table>
9 <p><a href="../market/index.html">return</a></p> </font></body></html> References 1. Marty Hall & Larry Brown, Core Servlets and Java Server Pages, First Edition, Sun Microsystems Press/Prentice-Hall PTR Book, W3 Schools Online Web Tutorials,
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
Brazil + JDBC Juin 2001, [email protected] http://jfod.cnam.fr/tp_cdi/douin/
Brazil + JDBC Juin 2001, [email protected] 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
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
CS412 Interactive Lab Creating a Simple Web Form
CS412 Interactive Lab Creating a Simple Web Form Introduction In this laboratory, we will create a simple web form using HTML. You have seen several examples of HTML pages and forms as you have worked
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
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
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
7 Web Databases. Access to Web Databases: Servlets, Applets. Java Server Pages PHP, PEAR. Languages: Java, PHP, Python,...
7 Web Databases Access to Web Databases: Servlets, Applets Java Server Pages PHP, PEAR Languages: Java, PHP, Python,... Prof. Dr. Dietmar Seipel 837 7.1 Access to Web Databases by Servlets Java Servlets
About webpage creation
About webpage creation Introduction HTML stands for HyperText Markup Language. It is the predominant markup language for Web=ages. > markup language is a modern system for annota?ng a text in a way that
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
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.
Chapter 9 Java and SQL. Wang Yang [email protected]
Chapter 9 Java and SQL Wang Yang [email protected] Outline Concern Data - File & IO vs. Database &SQL Database & SQL How Connect Java to SQL - Java Model for Database Java Database Connectivity (JDBC)
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
SQL and Java. Database Systems Lecture 19 Natasha Alechina
Database Systems Lecture 19 Natasha Alechina In this Lecture SQL in Java SQL from within other Languages SQL, Java, and JDBC For More Information Sun Java tutorial: http://java.sun.com/docs/books/tutorial/jdbc
Introduction to Web Design Curriculum Sample
Introduction to Web Design Curriculum Sample Thank you for evaluating our curriculum pack for your school! We have assembled what we believe to be the finest collection of materials anywhere to teach basic
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
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
HTML Form Widgets. Review: HTML Forms. Review: CGI Programs
HTML Form Widgets Review: HTML Forms HTML forms are used to create web pages that accept user input Forms allow the user to communicate information back to the web server Forms allow web servers to generate
CGI Programming. What is CGI?
CGI Programming What is CGI? Common Gateway Interface A means of running an executable program via the Web. CGI is not a Perl-specific concept. Almost any language can produce CGI programs even C++ (gasp!!)
Mini Project Report ONLINE SHOPPING SYSTEM
Mini Project Report On ONLINE SHOPPING SYSTEM Submitted By: SHIBIN CHITTIL (80) NIDHEESH CHITTIL (52) RISHIKESE M R (73) In partial fulfillment for the award of the degree of B. TECH DEGREE In COMPUTER
Java and Microsoft Access SQL Tutorial
Java and Microsoft Access SQL Tutorial Introduction: Last Update : 30 April 2008 Revision : 1.03 This is a short tutorial on how to use Java and Microsoft Access to store and retrieve data in an SQL database.
Internet Technologies
QAFQAZ UNIVERSITY Computer Engineering Department Internet Technologies HTML Forms Dr. Abzetdin ADAMOV Chair of Computer Engineering Department [email protected] http://ce.qu.edu.az/~aadamov What are forms?
Web Development and Core Java Lab Manual V th Semester
Web Development and Core Java Lab Manual V th Semester DEPT. OF COMPUTER SCIENCE AND ENGINEERING Prepared By: Kuldeep Yadav Assistant Professor, Department of Computer Science and Engineering, RPS College
Web Container Components Servlet JSP Tag Libraries
Web Application Development, Best Practices by Jeff Zhuk, JavaSchool.com ITS, Inc. [email protected] Web Container Components Servlet JSP Tag Libraries Servlet Standard Java class to handle an HTTP request
<option> eggs </option> <option> cheese </option> </select> </p> </form>
FORMS IN HTML A form is the usual way information is gotten from a browser to a server HTML has tags to create a collection of objects that implement this information gathering The objects are called widgets
HTML Tables. IT 3203 Introduction to Web Development
IT 3203 Introduction to Web Development Tables and Forms September 3 HTML Tables Tables are your friend: Data in rows and columns Positioning of information (But you should use style sheets for this) Slicing
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
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 [email protected] ACM / Crossroads / Columns / Connector / An Introduction
HTML Forms and CONTROLS
HTML Forms and CONTROLS Web forms also called Fill-out Forms, let a user return information to a web server for some action. The processing of incoming data is handled by a script or program written in
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
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
Form Validation. Server-side Web Development and Programming. What to Validate. Error Prevention. Lecture 7: Input Validation and Error Handling
Form Validation Server-side Web Development and Programming Lecture 7: Input Validation and Error Handling Detecting user error Invalid form information Inconsistencies of forms to other entities Enter
Caldes CM12: Content Management Software Introduction v1.9
Caldes CM12: Content Management Software Introduction v1.9 Enterprise Version: If you are using Express, please contact us. Background Information This manual assumes that you have some basic knowledge
Java Server Pages (JSP)
Java Server Pages (JSP) What is JSP JSP simply puts Java inside HTML pages. You can take any existing HTML page and change its extension to ".jsp" instead of ".html". Scripting elements are used to provide
Client-side Web Engineering From HTML to AJAX
Client-side Web Engineering From HTML to AJAX SWE 642, Spring 2008 Nick Duan 1 What is Client-side Engineering? The concepts, tools and techniques for creating standard web browser and browser extensions
PHP Tutorial From beginner to master
PHP Tutorial From beginner to master PHP is a powerful tool for making dynamic and interactive Web pages. PHP is the widely-used, free, and efficient alternative to competitors such as Microsoft's ASP.
Development. with NetBeans 5.0. A Quick Start in Basic Web and Struts Applications. Geertjan Wielenga
Web Development with NetBeans 5.0 Quick Start in Basic Web and Struts pplications Geertjan Wielenga Web Development with NetBeans 5 This tutorial takes you through the basics of using NetBeans IDE 5.0
Web Programming with PHP 5. The right tool for the right job.
Web Programming with PHP 5 The right tool for the right job. PHP as an Acronym PHP PHP: Hypertext Preprocessor This is called a Recursive Acronym GNU? GNU s Not Unix! CYGNUS? CYGNUS is Your GNU Support
Introduction to XHTML. 2010, Robert K. Moniot 1
Chapter 4 Introduction to XHTML 2010, Robert K. Moniot 1 OBJECTIVES In this chapter, you will learn: Characteristics of XHTML vs. older HTML. How to write XHTML to create web pages: Controlling document
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
Website as Tool for Compare Credit Card Offers
Website as Tool for Compare Credit Card Offers MIRELA-CATRINEL VOICU, IZABELA ROTARU Faculty of Economics and Business Administration West University of Timisoara ROMANIA [email protected], [email protected],
HTML Forms. Pat Morin COMP 2405
HTML Forms Pat Morin COMP 2405 HTML Forms An HTML form is a section of a document containing normal content plus some controls Checkboxes, radio buttons, menus, text fields, etc Every form in a document
CS 377 Database Systems SQL Programming. Li Xiong Department of Mathematics and Computer Science Emory University
CS 377 Database Systems SQL Programming Li Xiong Department of Mathematics and Computer Science Emory University 1 A SQL Query Joke A SQL query walks into a bar and sees two tables. He walks up to them
Security Code Review- Identifying Web Vulnerabilities
Security Code Review- Identifying Web Vulnerabilities Kiran Maraju, CISSP, CEH, ITIL, SCJP Email: [email protected] 1 1.1.1 Abstract Security Code Review- Identifying Web Vulnerabilities This paper
Interactive Data Visualization for the Web Scott Murray
Interactive Data Visualization for the Web Scott Murray Technology Foundations Web technologies HTML CSS SVG Javascript HTML (Hypertext Markup Language) Used to mark up the content of a web page by adding
Developing XML Solutions with JavaServer Pages Technology
Developing XML Solutions with JavaServer Pages Technology XML (extensible Markup Language) is a set of syntax rules and guidelines for defining text-based markup languages. XML languages have a number
JavaScript Basics & HTML DOM. Sang Shin Java Technology Architect Sun Microsystems, Inc. [email protected] www.javapassion.com
JavaScript Basics & HTML DOM Sang Shin Java Technology Architect Sun Microsystems, Inc. [email protected] www.javapassion.com 2 Disclaimer & Acknowledgments Even though Sang Shin is a full-time employee
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,
Designing for Dynamic Content
Designing for Dynamic Content Course Code (WEB1005M) James Todd Web Design BA (Hons) Summary This report will give a step-by-step account of the relevant processes that have been adopted during the construction
TABLE OF CONTENTS...2 INTRODUCTION...3 APPLETS AND APPLICATIONS...3 JAVABEANS...4 EXCEPTION HANDLING...5 JAVA DATABASE CONNECTIVITY (JDBC)...
Advanced Features Trenton Computer Festival May 1 sstt & 2 n d,, 2004 Michael P.. Redlich Senior Research Technician ExxonMobil Research & Engineering [email protected] Table of Contents
AIM: 1. Develop static pages (using Only HTML) of an online Book store. The pages should
Programs 1 Develop static pages (using Only HTML) of an online Book store.the pages should resemble: www.amazon.com.the website should consist the following pages. Home page Registration User Login Books
07 Forms. 1 About Forms. 2 The FORM Tag. 1.1 Form Handlers
1 About Forms For a website to be successful, it is important to be able to get feedback from visitors to your site. This could be a request for information, general comments on your site or even a product
The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics
2013 Marty Hall & Yaakov Chaikin The Google Web Toolkit (GWT): Declarative Layout with UiBinder Basics (GWT 2.5 Version) Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/gwt.html
InternetVista Web scenario documentation
InternetVista Web scenario documentation Version 1.2 1 Contents 1. Change History... 3 2. Introduction to Web Scenario... 4 3. XML scenario description... 5 3.1. General scenario structure... 5 3.2. Steps
1 SQL Data Types and Schemas
COMP 378 Database Systems Notes for Chapters 4 and 5 of Database System Concepts Advanced SQL 1 SQL Data Types and Schemas 1.1 Additional Data Types 1.1.1 User Defined Types Idea: in some situations, data
CS/CE 2336 Computer Science II
CS/CE 2336 Computer Science II UT D Session 23 Database Programming with Java Adapted from D. Liang s Introduction to Java Programming, 8 th Ed. and other sources 2 Database Recap Application Users Application
Security Module: SQL Injection
Security Module: SQL Injection Description SQL injection is a security issue that involves inserting malicious code into requests made to a database. The security vulnerability occurs when user provided
JDBC (Java / SQL Programming) CS 377: Database Systems
JDBC (Java / SQL Programming) CS 377: Database Systems JDBC Acronym for Java Database Connection Provides capability to access a database server through a set of library functions Set of library functions
Hello World RESTful web service tutorial
Hello World RESTful web service tutorial Balázs Simon ([email protected]), BME IIT, 2015 1 Introduction This document describes how to create a Hello World RESTful web service in Eclipse using JAX-RS
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
Why Is This Important? Database Application Development. SQL in Application Code. Overview. SQL in Application Code (Contd.
Why Is This Important? Database Application Development Chapter 6 So far, accessed DBMS directly through client tools Great for interactive use How can we access the DBMS from a program? Need an interface
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
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
By Glenn Fleishman. WebSpy. Form and function
Form and function The simplest and really the only method to get information from a visitor to a Web site is via an HTML form. Form tags appeared early in the HTML spec, and closely mirror or exactly duplicate
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
JavaScript and Dreamweaver Examples
JavaScript and Dreamweaver Examples CSC 103 October 15, 2007 Overview The World is Flat discussion JavaScript Examples Using Dreamweaver HTML in Dreamweaver JavaScript Homework 3 (due Friday) 1 JavaScript
Building Web Services with Apache Axis2
2009 Marty Hall Building Web Services with Apache Axis2 Part I: Java-First (Bottom-Up) Services Customized Java EE Training: http://courses.coreservlets.com/ Servlets, JSP, Struts, JSF/MyFaces/Facelets,
Sample HP OO Web Application
HP OO 10 OnBoarding Kit Community Assitstance Team Sample HP OO Web Application HP OO 10.x Central s rich API enables easy integration of the different parts of HP OO Central into custom web applications.
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,
BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS COPYRIGHT 2013 TERRY ANN MORRIS, ED.D
BASICS OF WEB DESIGN CHAPTER 2 HTML BASICS KEY CONCEPTS COPYRIGHT 2013 TERRY ANN MORRIS, ED.D 1 LEARNING OUTCOMES Describe the anatomy of a web page Format the body of a web page with block-level elements
Cover Page. Dynamic Server Pages Guide 10g Release 3 (10.1.3.3.0) March 2007
Cover Page Dynamic Server Pages Guide 10g Release 3 (10.1.3.3.0) March 2007 Dynamic Server Pages Guide, 10g Release 3 (10.1.3.3.0) Copyright 2007, Oracle. All rights reserved. Contributing Authors: Sandra
ICT 6012: Web Programming
ICT 6012: Web Programming Covers HTML, PHP Programming and JavaScript Covers in 13 lectures a lecture plan is supplied. Please note that there are some extra classes and some cancelled classes Mid-Term
So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going.
Web Design 1A First Website Intro to Basic HTML So we're set? Have your text-editor ready. Be sure you use NotePad, NOT Word or even WordPad. Great, let's get going. Ok, let's just go through the steps
Advanced Java Client API
2012 coreservlets.com and Dima May Advanced Java Client API Advanced Topics Originals of slides and source code for examples: http://www.coreservlets.com/hadoop-tutorial/ Also see the customized Hadoop
Application Security
2009 Marty Hall Declarative Web Application Security Originals of Slides and Source Code for Examples: http://courses.coreservlets.com/course-materials/msajsp.html Customized Java EE Training: http://courses.coreservlets.com/
public class ResultSetTable implements TabelModel { ResultSet result; ResultSetMetaData metadata; int num cols;
C H A P T E R5 Advanced SQL Practice Exercises 5.1 Describe the circumstances in which you would choose to use embedded SQL rather than SQL alone or only a general-purpose programming language. Writing
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
CSc 230 Software System Engineering FINAL REPORT. Project Management System. Prof.: Doan Nguyen. Submitted By: Parita Shah Ajinkya Ladkhedkar
CSc 230 Software System Engineering FINAL REPORT Project Management System Prof.: Doan Nguyen Submitted By: Parita Shah Ajinkya Ladkhedkar Spring 2015 1 Table of Content Title Page No 1. Customer Statement
Web Service Caching Using Command Cache
Web Service Caching Using Command Cache Introduction Caching can be done at Server Side or Client Side. This article focuses on server side caching of web services using command cache. This article will
CS 111 Classes I 1. Software Organization View to this point:
CS 111 Classes I 1 Software Organization View to this point: Data Objects and primitive types Primitive types operators (+, /,,*, %). int, float, double, char, boolean Memory location holds the data Objects
WHAT ARE PACKAGES? A package is a collection of related classes. This is similar to the notion that a class is a collection of related methods.
Java Packages KNOWLEDGE GOALS Understand what a package does. Organizes large collections of Java classes Provides access control for variables and methods using the modifier 'protected' Helps manage large
J a v a Quiz (Unit 3, Test 0 Practice)
Computer Science S-111a: Intensive Introduction to Computer Science Using Java Handout #11 Your Name Teaching Fellow J a v a Quiz (Unit 3, Test 0 Practice) Multiple-choice questions are worth 2 points
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
XHTML Forms. Form syntax. Selection widgets. Submission method. Submission action. Radio buttons
XHTML Forms Web forms, much like the analogous paper forms, allow the user to provide input. This input is typically sent to a server for processing. Forms can be used to submit data (e.g., placing an
How to Create a Mobile Responsive Template in ExactTarget
How to Create a Mobile Responsive Template in ExactTarget This manual contains the following: Section 1: How to create a new mobile responsive template for a Business Unit/Artist Section 2: How to adjust
An Overview of Java. overview-1
An Overview of Java overview-1 Contents What is Java Major Java features Java virtual machine Java programming language Java class libraries (API) GUI Support in Java Networking and Threads in Java overview-2
NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide
NGASI AppServer Manager SaaS/ASP Hosting Automation for Cloud Computing Administrator and User Guide NGASI SaaS Hosting Automation is a JAVA SaaS Enablement infrastructure that enables web hosting services
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,
Model-View-Controller. and. Struts 2
Model-View-Controller and Struts 2 Problem area Mixing application logic and markup is bad practise Harder to change and maintain Error prone Harder to re-use public void doget( HttpServletRequest request,
Chapter 1 Java Program Design and Development
presentation slides for JAVA, JAVA, JAVA Object-Oriented Problem Solving Third Edition Ralph Morelli Ralph Walde Trinity College Hartford, CT published by Prentice Hall Java, Java, Java Object Oriented
Supplement IV.D: Tutorial for MS Access. For Introduction to Java Programming By Y. Daniel Liang
Supplement IV.D: Tutorial for MS Access For Introduction to Java Programming By Y. Daniel Liang This supplement covers the following topics: Creating Databases and Executing SQL Creating ODBC Data Source
Example. Represent this as XML
Example INF 221 program class INF 133 quiz Assignment Represent this as XML JSON There is not an absolutely correct answer to how to interpret this tree in the respective languages. There are multiple
By : Ashish Modi. CRUD USING PHP (Create, Read, Update and Delete on Database) Create Database and Table using following Sql Syntax.
CRUD USING PHP (Create, Read, Update and Delete on Database) Create Database and Table using following Sql Syntax. create database test; CREATE TABLE `users` ( `id` int(11) NOT NULL auto_increment, `name`
Java Programming. JDBC Spring Framework Web Services
Chair of Software Engineering Java Programming Languages in Depth Series JDBC Spring Framework Web Services Marco Piccioni May 31st 2007 What will we be talking about Java Data Base Connectivity The Spring
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).
