Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
1
/9
SEMESTER TWO EXAMINATIONS 2004
MODULE:
EE557
–
Server
-
Side Development
COURSE:
M.Eng/Grad.Dip/Cert Telecommunications Engineering
M.Eng/Grad. Dip/Cert Electronic Systems
RACeE Programme
YEAR:
5
EXAMINER:
MR. DAVID MOLLOY
(Room
S349 Ext: 8426)
EXTERNAL EXAMINER:
PROF. PATRICK J. MURPHY
TIME ALLOWED:
180 MINS
INSTRUCTIONS:
ANSWER 4 OUT OF ANY 5 QUESTIONS
EACH QUESTION CARRIES EQUAL MARKS
Files associated with questions to be supplied
both in attached Appendices and on t
he network
This booklet contains
9
pages, including the cover sheet and Appendices
PLEASE DO NOT TURN OVER THIS PAGE UNTIL YOU ARE INSTRUCTED TO DO SO
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
2
/9
Question 1
(
Note:
paper
-
based question)
a)
Given the two following tables in Appendix A:
-
CUSTO
MERS
-
SALESTEAM
Provide the SQL required to create a third table, ‘SALES’, with the following properties and
relationships:
i)
Contains item name, date of purchase & shop of purchase
ii)
Contains a unique ID for each sales entry (an integer)
iii)
Has two suitable f
oreign key relationships, one with the CUSTOMERS table and the
other with the SALESTEAM table.
iv)
If a customer entry is deleted from the CUSTOMERS table, the corresponding
entries in the SALES table should be set to a default value ‘NA’.
v)
If an entry in the S
ALESTEAM table is deleted, the corresponding foreign key in the
SALES table should be set to NULL.
[9 marks]
b)
Create a multi
-
row INSERT statement to insert all customers from either Ireland or England
into a separate table called LOCALCUSTOMERS (which yo
u can assume has the same
form and already exists).
[3 marks]
c)
A new order is placed in your IT system. Tony Maples purchases a Sony DVD player
costing €299
-
from salesperson Derek Trotter. Provide the SQL statements involved to
comple
te a valid transaction.
[4 marks]
d)
Provide
three
advantages and
two
disadvantages in using database ‘Views’.
[5 marks]
e)
Explain, with an example using any of the tables above, the difference between a Horizontal
View an
d a Vertical View.
[4 marks]
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
3
/9
Question 2
a)
Given the following list of data, create a well
-
formed XML file (books.xml) to represent the
data. Create a corresponding DTD (books.dtd) to describe the data structure and validate
your XML file agai
nst this DTD.
[10 marks]
Book 1:
Title: J2EE Unleashed
Authors: Paul R. Allen, Joseph J. Bambara
Year: 2002 Publisher: Sams
Topic Keywords: Java, J2EE, Servlets, EJBs
Book 2:
Title: Client/Server Survival Guide
Authors: Robert Orfali
Year: 1999
Topic Keywords: Clients, Server Technologies
b)
Write an XSL file (books.xsl) which would display the XML data above in a similar style to
that shown below. A few sample XSL lines have been
provided in Appendix B.
[8 marks]
c)
Using JAXP, write a Java application to perform a transformation using the XML file from
(a) above and the XSL file from (b) above. To aid in this process, you should start with
Co
nvert.java (in Appendix B and on the network)
, which contains some code, which you
may use as an aid.
[7 marks]
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
4
/9
Question 3
a)
What is SOAP? Explain why and how it is used.
[6 marks]
b)
Describe, with the aid of a diagram,
the structure and contents of a SOAP message.
[6 marks]
c)
Provide four benefits in using Enterprise Beans.
[4 marks]
d)
Explain the following, relating to distributed programming
-
Serialization
-
Bean
-
Managed Persistence
-
Stateful/Stateless Beans
[9 marks]
Question 4
a)
Explain the following terms in relation to JNDI.
-
context
-
directory service
-
LDAP
[6 marks]
b)
“Form validation can be performed either on the client
-
side or server
-
side”.
Discuss this statement, indicating how this is achieved and highlighting a
ny major
considerations.
[5 marks]
c)
What are ‘mutual exclusion issues’? Explain, with the aid of a diagram and
your own
example
(avoid using an identical example to that contained in the notes) how such an issue
might arise, and in turn how it might be ha
ndled.
[8 marks]
d)
In relation to the Java Messaging Service API, list the steps involved in performing
communication using the Point
-
to
-
Point Message Model.
Note:
You need not write the Java code, but rather should detail the major steps.
[6 marks]
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
5
/9
Que
stion 5
a)
Explain the concept of session tracking and why it is used.
[4 marks]
b)
Write a servlet, which will take in two parameters from a form (using the GET method).
The servlet should print out the two values to a HTML page and additionally store the t
wo
values on the user session.
Note:
You are not required to create the HTML Form.
[7 marks]
c)
Write a corresponding JSP, which will read in the same two parameters from the session and
display the two values, previously initialized b
y the servlet in (b). The JSP should also
inform the user if the initialization had not previously occurred.
[6 marks]
d)
There are two main types of classes that implement the
javax.servlet.Servlet
interface. Name
them and provide a brief explanatio
n for each.
[4 marks]
e)
Name four advantages of Java Servlets, with a brief sentence describing each.
[4 marks]
Important:
-
Please study the information provided in
Appendix C
, regarding compilation and
deployment of servlets and web appli
cations.
-
The ‘C:
\
temp
\
Tomcat
\
src’ directory contains a Servlet template ‘HelloWorld.java’ you can
use as a template to aid in development. It also contains an unzipped servlet.jar to aid in
compilation.
-
Likewise, you may use the source code of any examp
les in the standard Examples section
of Tomcat to aid in development.
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
6
/9
APPENDIX A
CUSTOMERS
CUST_ID
SURNAME
FIRSTNAME
COUNTRY
USERNAME
A43432
Jones
Peter
Ireland
jonesp
B53431
Johnson
Roger
England
johnsonr2
M20444
Riordan
Maggie
Ireland
riordanm
G09311
Daly
Rachel
United States
dalyr
U43999
Maples
Tony
Canada
maplest9
.
.
.
.
.
.
.
.
.
.
B90394
George
Ben
Ireland
georgeb4
SALESTEAM
SP_ID
SURNAME
FIRSTNAME
DEPARTMENT
SALES_TOTAL
87
Trotter
Derek
Electrical
34,592
23
O’Rourke
Rachel
Elect
rical
18,545
14
Grumble
Barney
Hardware
54,181
7
Molloy
Ruby
Hardware
65,933
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
7
/9
APPENDIX B
books.xsl
<?xml version="1.0" encoding="UTF
-
8" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/books">
…… Your XSL here …..
</xsl:template>
</xsl:stylesheet>
Convert.java
import org.w3c.dom.DOMException;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.FactoryConfigurati
onError;
import javax.xml.parsers.ParserConfigurationException;
import java.io.*;
public class Convert
{
public static void main (String argv[])
{
try {
// Your code here
// You need not pass files as arguments
–
you ma
y assume they are static names
}
catch (SAXParseException spe) {
System.out.println("
\
nParsing Error
\
n");
}
catch (ParserConfigurationException pce) {
System.out.println("
\
nParserConfigurationException!
\
n");
}
catch (TransformerConfigurationException tce) {
System.out.println("
\
nTransformerConfigurationException!
\
n");
}
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
8
/9
catch (TransformerException te) {
System.out.println("
\
nTransformer Exception!");
}
catch (SAXException se)
{
System.out.println("
\
nSAXException!");
}
catch (IOException ioe) {
System.out.println("
\
nIOException!");
}
}
}
Server
-
Side Development
–
EE557
-
Semester Two 2004
Page
9
/9
APPENDIX C
-
To set up a command prompt for compiling, please use START
-
>PROGRAMS
-
>JDK
Environment
-
> J2sdk1
.4.1
-
> jdk1.4.1
-
To view the Standard Edition JavaDocs, open a browser and select to Open the following
location: F:/J2sdk1.4.1/docs/api/index.html
-
Tomcat can be run from START
-
> PROGRAMS
-
> TOMCAT4.1
-
>Tomcat Startup
This will take about one minute to
complete startup. You should wait for the line ending
with “jk2.properties”
-
This link will run a batch file which creates a default context called ‘student’ which you can
use for development during the exam. The context root for this web application ca
n be
found at C:
\
Temp
\
Tomcat
\
student
-
As this context is set as reloadable=”false” you should use the Tomcat Manager Application
, after you startup Tomcat, to reload your Web Application when needed. A link from this
can be found at the main startup page
http://localhost:8080 (Username: admin, Password:
admin)
-
The Servlet/JSP Javadocs can be found within ‘Tomcat Documentation’ from the main
startup page http://localhost:8080
Enter the password to open this PDF file:
File name:
-
File size:
-
Title:
-
Author:
-
Subject:
-
Keywords:
-
Creation Date:
-
Modification Date:
-
Creator:
-
PDF Producer:
-
PDF Version:
-
Page Count:
-
Preparing document for printing…
0%
Comments 0
Log in to post a comment