Anchor | ||||
---|---|---|---|---|
|
Article donated by: Henry Isidro, Leonard Flournoy, Hernan Cunico
...
Sample application
Anchor | ||||
---|---|---|---|---|
|
This sample application Session Bean Sample Application shows how session beans are used and deployed in a container. There are two clients, one for stateless session beans and another for stateful session beans. Both client applications use the same database which contains a table that stores loan application details. An entity bean is used to connect to and operate on the loan details table. A session bean is then used by the client application to get specific details from the database using the entity bean. The first client creates a stateless session bean and displays a list of denied loan applications via a method defined in that EJB. The second client creates a stateful session bean and adds loan applications to the database.
The following figure illustrates the application flow:
Application Beans
...
Download the Session Bean sample application from the following URL:link:
Session Bean Samplehttp://opensource2.atlassian.com/confluence/oss/download/attachments/1155/session.zip
After extracting the zip file, a session directory will be created. From now on, this directory will be referred as <session_home>.
...
The following figures illustrate the home page for the Web Application as well as the testing for the stateless and stateful beans depending on your selection on the Web Application home page.
The Geronimo environment
Anchor | ||||
---|---|---|---|---|
|
...
CREATE TABLE CUSTOMER(ID INTEGER NOT NULL PRIMARY KEY,NAME VARCHAR(45),BIRTHDATE DATE,SSS_NO VARCHAR(25),ADDRESS VARCHAR(60),ANNUAL_SALARY DOUBLE,LOAN_AMOUNT DOUBLE)
Step-by-step migration
Anchor | ||||
---|---|---|---|---|
|
...
As with JBoss, the following figures illustrate the home page for the Web Application as well as the testing for the stateless and stateful beans depending on your selection on the Web Application home page.
Summary
Anchor | ||||
---|---|---|---|---|
|
...