Sie sind auf Seite 1von 4

Online Examination


Curriculum: ACCP2005 Exam Date:

Subject: EJB 03/03/2009

Duration: 120 minutes Total Marks: 25



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
o Remove a product.

* Note:
Use file sqljdbc.jar included to connect to this database when needed

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.provider.url", "jnp://");
properties.put("jnp.disableDiscovery", "true");
return new InitialContext(properties); }
- Refer this jboss.xml file for session bean:
<?xml version="1.0" encoding="UTF-8"?>
- Refer this web.xml file for security:

Practical Paper QP Page 3 of 4

<realm-name>My Security Zone</realm-name>
- Refer this jboss-web.xml file for security:
<security-domain flushOnSessionInvalidation="false">

Practical Paper QP Page 4 of 4