0% found this document useful (0 votes)
73 views4 pages

Question Paper: Modul Test Practical

This document provides instructions for two questions on an exam for the subject EJB. Question 1 involves creating a stateless session bean application that returns phone prices and displays them when selected. Question 2 involves creating a BMP entity bean application to find and remove a product from a database table by ID using a Swing client. Details are provided on database connection properties, XML configuration files for the session bean, security constraints, and security domain.

Uploaded by

api-19762664
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views4 pages

Question Paper: Modul Test Practical

This document provides instructions for two questions on an exam for the subject EJB. Question 1 involves creating a stateless session bean application that returns phone prices and displays them when selected. Question 2 involves creating a BMP entity bean application to find and remove a product from a database table by ID using a Swing client. Details are provided on database connection properties, XML configuration files for the session bean, security constraints, and security domain.

Uploaded by

api-19762664
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 4

Online Examination

QUESTION PAPER

Curriculum: ACCP2005 Exam Date:


Subject: EJB 03/03/2009

Duration: 120 minutes Total Marks: 25

MODUL TEST PRACTICAL

EJB

Practical Paper QP Page 1 of 4


Question 1: [15]
Create a Stateless Session Bean application to do the following tasks:
1. Create a bean named “PriceList”, which provide the price of some Mobile

phones [4]
2. Create 2 bussiness methods named “Nokia7200()” and “SamsungE700()”,
which return the price of a Nokia7200 and a SamsungE700 mobile phone.

Return type is integer [3]

3. Create a web client application to use that bean

When user choose the corresponding mobile phone in the form and submit, then

connect to the bean and display the result [6]

4. Set BASIC Security mode in Web Application so that only role “admin” can

use the services [2]


Question 2: [10]
Create a BMP entity bean application to do the following tasks:
- The bean map to table tblProduct (id,productName) in the Database (SQL
Server 2005). There are methods findByPrimaryKey() and remove().
- Create a Swing Client to connect to BMP Bean
o Find a product by id with id=1. Display productName of that
product
o Remove a product.

* Note:
Use file sqljdbc.jar included to connect to this database when needed
Driver: com.microsoft.sqlserver.jdbc.SQLServerDriver

Practical Paper QP Page 2 of 4


URL: jdbc:sqlserver://serverName:port;databaseName=…";
- Refer the getInitialContext() method
private static Context getInitialContext() throws NamingException
{ Properties properties = new Properties();
properties.put("java.naming.factory.initial",
"org.jnp.interfaces.NamingContextFactory");
properties.put("java.naming.factory.url.pkgs",
"jboss.naming:org.jnp.interfaces");
properties.put("java.naming.provider.url", "jnp://127.0.0.1:1099");
properties.put("jnp.disableDiscovery", "true");
return new InitialContext(properties); }
- Refer this jboss.xml file for session bean:
<?xml version="1.0" encoding="UTF-8"?>
<jboss>
<enterprise-beans>
<session>
<ejb-name>Test</ejb-name>
<jndi-name>Test</jndi-name>
</session>
</enterprise-beans>
</jboss>
- Refer this web.xml file for security:
<security-constraint>
<display-name>Constraint1</display-name>
<web-resource-collection>
<web-resource-name>AllResource</web-resource-name>
<description/>
<url-pattern>/*</url-pattern>
</web-resource-collection>
<auth-constraint>
<description/>
<role-name>admin</role-name>
</auth-constraint>
<user-data-constraint>
<description/>

Practical Paper QP Page 3 of 4


<transport-guarantee>NONE</transport-guarantee>
</user-data-constraint>
</security-constraint>
<login-config>
<auth-method>BASIC</auth-method>
<realm-name>My Security Zone</realm-name>
</login-config>
<security-role>
<description/>
<role-name>member</role-name>
</security-role>
<security-role>
<description/>
<role-name>admin</role-name>
</security-role>
- Refer this jboss-web.xml file for security:
<security-domain flushOnSessionInvalidation="false">
java:/jaas/yourPolicy
</security-domain>

Practical Paper QP Page 4 of 4

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy