geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From build...@apache.org
Subject svn commit: r917744 [11/31] - in /websites/production/geronimo/content: GMOxDOC20/ GMOxDOC20/geronimo-eclipse-plugin-installation-instructions.data/ cache/
Date Tue, 29 Jul 2014 00:52:21 GMT
Modified: websites/production/geronimo/content/GMOxDOC20/ejb-sample-application.html
==============================================================================
--- websites/production/geronimo/content/GMOxDOC20/ejb-sample-application.html (original)
+++ websites/production/geronimo/content/GMOxDOC20/ejb-sample-application.html Tue Jul 29
00:52:18 2014
@@ -23,6 +23,7 @@
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shCore.js' type='text/javascript'></script>
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushJava.js'
type='text/javascript'></script>
   <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushXml.js'
type='text/javascript'></script>
+  <script src='http://geronimo.apache.org/resources/highlighter/scripts/shBrushPlain.js'
type='text/javascript'></script>
   
   <script type="text/javascript">
   SyntaxHighlighter.defaults['toolbar'] = false;
@@ -95,16 +96,31 @@
 
       <div class="pagecontent">
         <div class="wiki-content">
-          <div class="wiki-content maincontent"><style type="text/css">/*<![CDATA[*/
-table.ScrollbarTable  {border: none;padding: 3px;width: 100%;padding: 3px;margin: 0px;background-color:
#f0f0f0}
-table.ScrollbarTable td.ScrollbarPrevIcon {text-align: center;width: 16px;border: none;}
-table.ScrollbarTable td.ScrollbarPrevName {text-align: left;border: none;}
-table.ScrollbarTable td.ScrollbarParent {text-align: center;border: none;}
-table.ScrollbarTable td.ScrollbarNextName {text-align: right;border: none;}
-table.ScrollbarTable td.ScrollbarNextIcon {text-align: center;width: 16px;border: none;}
+          <div class="wiki-content maincontent">    
+<div class="atb-scrollbar-macro">
+    <div class="prev">
+        <a shape="rect" href="deploy-and-run-j2ee-application-client.html" rel="prev">
+                                    <span class="aui-icon aui-icon-small atb-icon-arrow-left">Previous</span>
+                                <span class="title">Deploy and run J2EE Application
Client</span>
+            </a>
 
-/*]]>*/</style><div class="Scrollbar"><table class="ScrollbarTable"><tr><td
colspan="1" rowspan="1" class="ScrollbarPrevIcon"><a shape="rect" href="deploy-and-run-j2ee-application-client.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/back_16.gif"
width="16" height="16"></a></td><td colspan="1" rowspan="1" class="ScrollbarPrevName"
width="33%"><a shape="rect" href="deploy-and-run-j2ee-application-client.html">Deploy
and run J2EE Application Client</a>&#160;</td><td colspan="1" rowspan="1"
class="ScrollbarParent" width="33%"><sup><a shape="rect" href="sample-applications.html"><img
align="middle" border="0" src="https://cwiki.apache.org/confluence/images/icons/up_16.gif"
width="8" height="8"></a></sup><a shape="rect" href="sample-applications.html">Sample
applications</a></td><td colspan="1" rowspan="1" class="ScrollbarNextName"
width="33%">&#160;<a shape="rect" href="how-to-get-jndi-working-in-geronimo-20.html">How
to get JNDI working in Ge
 ronimo 2.0</a></td><td colspan="1" rowspan="1" class="ScrollbarNextIcon"><a
shape="rect" href="how-to-get-jndi-working-in-geronimo-20.html"><img align="middle"
border="0" src="https://cwiki.apache.org/confluence/images/icons/forwd_16.gif" width="16"
height="16"></a></td></tr></table></div>
-<p><a shape="rect" name="EJBsampleapplication-top"></a><br clear="none">
+    </div>
+    <div class="parent">
+                    <a shape="rect" href="sample-applications.html" rel="parent">
+                                            <span class="aui-icon aui-icon-small atb-icon-arrow-up">Up</span>
+                                        <span class="title">Sample applications</span>
+                </a>
+
+            </div>
+    <div class="next">
+        <a shape="rect" href="how-to-get-jndi-working-in-geronimo-20.html" rel="next">
+                <span class="title">How to get JNDI working in Geronimo 2.0</span>
+                                    <span class="aui-icon aui-icon-small atb-icon-arrow-right">Next</span>
+                            </a>
+
+    </div>
+</div>
+<p><span class="confluence-anchor-link" id="EJBsampleapplication-top"></span><br
clear="none">
 Enterprise Java Beans has been one of the corner stones of the J2EE specification. As a J2EE
1.5 certified application server, Apache Geronimo supports EJB's extensively with the help
of OpenEJB EJB Container. Although it is possible to use standard Java objects to contain
your business logic and business data, using EJBs addresses many of the issues of using simple
Java objects, such as scalability, lifecycle management and state management. In this article,
you will see how an initial database application is extended and used for both local and remotely
referred application clients for an Enterprise Java Beans back end. The application uses the
built-in Apache Derby as its database. Use this article to learn how to simplify your enterprise
application development process.</p>
 
 <p>Banking application has two types of application clients namely "Banking Remote
Application" and "Banking Web Application". Each of these clients demonstrate how to refer
Enterprise Java Beans in remote and local interfaces respectively. Both these clients are
referring a common business layer which has been implemented with the help of Session and
Entity Beans. Stateless Session Beans are acting as the business service interface between
business entities and application clients. All the business entities of the application layer
are implemented with Entity Beans.</p>
@@ -115,13 +131,13 @@ Enterprise Java Beans has been one of th
 <ul><li><a shape="rect" href="#EJBsampleapplication-overview">Overview
of EJB Features</a></li><li><a shape="rect" href="#EJBsampleapplication-application">Application
Overview</a></li><li><a shape="rect" href="#EJBsampleapplication-configure">Configuring,
Building and Deploying the Sample Application</a></li><li><a shape="rect"
href="#EJBsampleapplication-testing">Testing of the Sample Application</a></li><li><a
shape="rect" href="#EJBsampleapplication-summary">Summary</a></li></ul>
 
 
-<h1><a shape="rect" name="EJBsampleapplication-OverviewofEJBFeatures"></a>Overview
of EJB Features <a shape="rect" name="EJBsampleapplication-overview"></a></h1>
+<h1 id="EJBsampleapplication-OverviewofEJBFeaturesoverview">Overview of EJB Features
<span class="confluence-anchor-link" id="EJBsampleapplication-overview"></span></h1>
 
 <p>EJB implementation may vary from one vendor to another.The following are the main
list of features Apache Geronimo supports as a J2EE container.</p>
 <ul><li>Stateful and stateless Session Beans</li><li>Entity Beans</li><li>Message
driven beans (MDBs)</li><li>Interoperability using RMI-IIOP or JAXRPC</li><li>Ability
to expose stateless session beans and MDBs as Web Services</li><li>Support for
sending and receiving messages via Web Services</li><li>Easy provisioning and
hot deployment of EJB and JMX-based Web Services</li><li>Access to EJBs from external
CORBA objects</li></ul>
 
 
-<h1><a shape="rect" name="EJBsampleapplication-ApplicationOverview"></a>Application
Overview <a shape="rect" name="EJBsampleapplication-application"></a></h1>
+<h1 id="EJBsampleapplication-ApplicationOverviewapplication">Application Overview <span
class="confluence-anchor-link" id="EJBsampleapplication-application"></span></h1>
 
 <p>As mentioned above the Banking application supports two types of business application
clients.The overview of each client is given below.</p>
 <ol><li>Banking Remote Application<br clear="none">
@@ -131,7 +147,7 @@ This is a Web application open to the Cu
 
 <p>Both of these clients use a common business service layer. Behind that business
service layer, there are three common business entities that appear in the banking application
domain Account, Customer and ExchangeRate. Each Customer can have more than one Account while
an Account can only be owned by one Customer. ExchangeRate represents a rate value given by
the bank relative to the USD for a particular currency.</p>
 
-<h2><a shape="rect" name="EJBsampleapplication-Applicationcontents"></a>Application
contents</h2>
+<h2 id="EJBsampleapplication-Applicationcontents">Application contents</h2>
 
 <p>The Banking application consists of the following list of packages and classes.</p>
 <ul><li>org.apache.geronimo.samples.bank.ejb
@@ -166,12 +182,12 @@ This is a Web application open to the Cu
 </div></div>
 <p>First, we will look at how the business service layer of the application has been
implemented with the help of EJBs.</p>
 
-<p>Corresponding <b>openejb-jar.xml</b> defines Geronimo specific features
of EJBs. Since we will deploy the database pool along with the application, there is no need
to provide a dependency to an existing database pool.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>openejb-jar.xml</b></div><div
class="codeContent panelContent">
+<p>Corresponding <strong>openejb-jar.xml</strong> defines Geronimo specific
features of EJBs. Since we will deploy the database pool along with the application, there
is no need to provide a dependency to an existing database pool.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>openejb-jar.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;openejb-jar xmlns="http://www.openejb.org/xml/ns/openejb-jar-2.1"&gt;
-	&lt;dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;openejb-jar xmlns=&quot;http://www.openejb.org/xml/ns/openejb-jar-2.1&quot;&gt;
+	&lt;dep:environment xmlns:dep=&quot;http://geronimo.apache.org/xml/ns/deployment-1.2&quot;&gt;
 		&lt;dep:moduleId&gt;
 			&lt;dep:groupId&gt;${pom.groupId}&lt;/dep:groupId&gt;
 			&lt;dep:artifactId&gt;${pom.artifactId}&lt;/dep:artifactId&gt;
@@ -191,21 +207,21 @@ This is a Web application open to the Cu
 &lt;/openejb-jar&gt;
 ]]></script>
 </div></div>
-<p><b>persistence.xml</b> defines a persistence unit which is used by an
EntityManagerFactory in order to talk to BankDB through the BankPool configuration. The name
that is given to this &lt;persistent-unit&gt; will be used when trying to reference
it via an annotation in the EJB. By setting the <b>SynchronizeMappings</b> property
it will not overwrite what is already in the database. So this is important to have when you
do not want your data to be deleted. The jta-data-source and non-jta-data-source should point
to the same thing.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>persistence.xml</b></div><div
class="codeContent panelContent">
+<p><strong>persistence.xml</strong> defines a persistence unit which is
used by an EntityManagerFactory in order to talk to BankDB through the BankPool configuration.
The name that is given to this &lt;persistent-unit&gt; will be used when trying to
reference it via an annotation in the EJB. By setting the <strong>SynchronizeMappings</strong>
property it will not overwrite what is already in the database. So this is important to have
when you do not want your data to be deleted. The jta-data-source and non-jta-data-source
should point to the same thing.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>persistence.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;persistence 	xmlns="http://java.sun.com/xml/ns/persistence"
-		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.0"
-		xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd"&gt;
-	&lt;persistence-unit name="BankPU"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;persistence 	xmlns=&quot;http://java.sun.com/xml/ns/persistence&quot;
+		xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; version=&quot;1.0&quot;
+		xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd&quot;&gt;
+	&lt;persistence-unit name=&quot;BankPU&quot;&gt;
 		&lt;description&gt;Entity Beans for Bank&lt;/description&gt;
 		&lt;provider&gt;org.apache.openjpa.persistence.PersistenceProviderImpl&lt;/provider&gt;
 		&lt;class&gt;org.apache.geronimo.samples.bank.ejb.Account&lt;/class&gt;
 		&lt;class&gt;org.apache.geronimo.samples.bank.ejb.Customer&lt;/class&gt;
 		&lt;class&gt;org.apache.geronimo.samples.bank.ejb.ExchangeRate&lt;/class&gt;
 		&lt;properties&gt;
-			&lt;property name="openjpa.jdbc.SynchronizeMappings" value="false" /&gt;
+			&lt;property name=&quot;openjpa.jdbc.SynchronizeMappings&quot; value=&quot;false&quot;
/&gt;
 		&lt;/properties&gt;
 		&lt;jta-data-source&gt;BankPool&lt;/jta-data-source&gt;
 		&lt;non-jta-data-source&gt;BankPool&lt;/non-jta-data-source&gt;
@@ -213,14 +229,14 @@ This is a Web application open to the Cu
 &lt;/persistence&gt;
 ]]></script>
 </div></div>
-<p><b>web.xml</b> does not do anything special here. It just enumerates
the servlets present in the web-app and maps the url-pattern for each of them.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent">
+<p><strong>web.xml</strong> does not do anything special here. It just
enumerates the servlets present in the web-app and maps the url-pattern for each of them.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>web.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;web-app xmlns="http://java.sun.com/xml/ns/j2ee"
-		xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-		xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd"
-		version="2.5"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;web-app xmlns=&quot;http://java.sun.com/xml/ns/j2ee&quot;
+		xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
+		xsi:schemaLocation=&quot;http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_5.xsd&quot;
+		version=&quot;2.5&quot;&gt;
 
 	&lt;welcome-file-list&gt;
 		&lt;welcome-file&gt;/index.html&lt;/welcome-file&gt;
@@ -250,11 +266,11 @@ This is a Web application open to the Cu
 &lt;/web-app&gt;
 ]]></script>
 </div></div>
-<p><b>geronimo-web.xml</b> is the Geronimo specific deployment plan. As
usual, it specifies the module's information and context-root. So in order to visit the web-app
the root url will be <a shape="rect" class="external-link" href="http://localhost:8080/Bank"
rel="nofollow">http://localhost:8080/Bank</a>.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml</b></div><div
class="codeContent panelContent">
+<p><strong>geronimo-web.xml</strong> is the Geronimo specific deployment
plan. As usual, it specifies the module's information and context-root. So in order to visit
the web-app the root url will be <a shape="rect" class="external-link" href="http://localhost:8080/Bank"
rel="nofollow">http://localhost:8080/Bank</a>.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-web.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;web-app xmlns="http://geronimo.apache.org/xml/ns/j2ee/web-1.1" xmlns:naming="http://geronimo.apache.org/xml/ns/naming-1.1"&gt;
-	&lt;dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"&gt;
+&lt;web-app xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/web-1.1&quot;
xmlns:naming=&quot;http://geronimo.apache.org/xml/ns/naming-1.1&quot;&gt;
+	&lt;dep:environment xmlns:dep=&quot;http://geronimo.apache.org/xml/ns/deployment-1.1&quot;&gt;
 		&lt;dep:moduleId&gt;
 			&lt;dep:groupId&gt;${pom.groupId}&lt;/dep:groupId&gt;
 			&lt;dep:artifactId&gt;${pom.artifactId}&lt;/dep:artifactId&gt;
@@ -270,11 +286,11 @@ This is a Web application open to the Cu
 &lt;/web-app&gt;
 ]]></script>
 </div></div>
-<p><b>BankPool.xml</b> provides the connection information for a database
on Geronimo. In this case we are using Geronimo's built-in Derby database. The dependency
for it should actually be org.apache.geronimo.configs/system-database//car. It has caused
me problems when trying to use anything different. The following database pool plan is generated
from the console. The only change I made to it was the dependency to make it point to the
system-database where the derby engine is running. This db pool will be deployed with the
EAR application.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>BankPool.xml</b></div><div
class="codeContent panelContent">
+<p><strong>BankPool.xml</strong> provides the connection information for
a database on Geronimo. In this case we are using Geronimo's built-in Derby database. The
dependency for it should actually be org.apache.geronimo.configs/system-database//car. It
has caused me problems when trying to use anything different. The following database pool
plan is generated from the console. The only change I made to it was the dependency to make
it point to the system-database where the derby engine is running. This db pool will be deployed
with the EAR application.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>BankPool.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;connector xmlns="http://geronimo.apache.org/xml/ns/j2ee/connector-1.1"&gt;
-	&lt;dep:environment xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.1"&gt;
+&lt;connector xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/connector-1.1&quot;&gt;
+	&lt;dep:environment xmlns:dep=&quot;http://geronimo.apache.org/xml/ns/deployment-1.1&quot;&gt;
 		&lt;dep:moduleId&gt;
 			&lt;dep:groupId&gt;console.dbpool&lt;/dep:groupId&gt;
 			&lt;dep:artifactId&gt;BankPool&lt;/dep:artifactId&gt;
@@ -295,9 +311,9 @@ This is a Web application open to the Cu
 				&lt;connectionfactory-interface&gt;javax.sql.DataSource&lt;/connectionfactory-interface&gt;
 				&lt;connectiondefinition-instance&gt;
 					&lt;name&gt;BankPool&lt;/name&gt;
-					&lt;config-property-setting name="Driver"&gt;org.apache.derby.jdbc.EmbeddedDriver&lt;/config-property-setting&gt;
-					&lt;config-property-setting name="UserName"&gt;app&lt;/config-property-setting&gt;
-					&lt;config-property-setting name="ConnectionURL"&gt;jdbc:derby:BankDB&lt;/config-property-setting&gt;
+					&lt;config-property-setting name=&quot;Driver&quot;&gt;org.apache.derby.jdbc.EmbeddedDriver&lt;/config-property-setting&gt;
+					&lt;config-property-setting name=&quot;UserName&quot;&gt;app&lt;/config-property-setting&gt;
+					&lt;config-property-setting name=&quot;ConnectionURL&quot;&gt;jdbc:derby:BankDB&lt;/config-property-setting&gt;
 					&lt;connectionmanager&gt;
 						&lt;local-transaction/&gt;
 						&lt;single-pool&gt;
@@ -313,12 +329,12 @@ This is a Web application open to the Cu
 &lt;/connector&gt;
 ]]></script>
 </div></div>
-<p><b>geronimo-application.xml</b> tells the application that there is
a database pool that needs to be deployed as well. The db pool is defined in <b>BankPool.xml</b>
and the driver that is needs in order to be deployed is the <b>tranql-connector-ra-1.3.rar</b>
file--these two files will reside on the top level layer of the resultant EAR file.</p>
-<div class="code panel" style="border-style: solid;border-width: 1px;"><div class="codeHeader
panelHeader" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-application.xml</b></div><div
class="codeContent panelContent">
+<p><strong>geronimo-application.xml</strong> tells the application that
there is a database pool that needs to be deployed as well. The db pool is defined in <strong>BankPool.xml</strong>
and the driver that is needs in order to be deployed is the <strong>tranql-connector-ra-1.3.rar</strong>
file--these two files will reside on the top level layer of the resultant EAR file.</p>
+<div class="code panel pdl" style="border-style: solid;border-width: 1px;"><div
class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;border-bottom-style: solid;"><b>geronimo-application.xml</b></div><div
class="codeContent panelContent pdl">
 <script class="theme: Default; brush: xml; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;?xml version="1.0" encoding="UTF-8"?&gt;
-&lt;application xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-1.2"&gt;
-    &lt;environment xmlns="http://geronimo.apache.org/xml/ns/deployment-1.2"&gt;
+&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
+&lt;application xmlns=&quot;http://geronimo.apache.org/xml/ns/j2ee/application-1.2&quot;&gt;
+    &lt;environment xmlns=&quot;http://geronimo.apache.org/xml/ns/deployment-1.2&quot;&gt;
         &lt;moduleId&gt;
             &lt;groupId&gt;${pom.groupId}&lt;/groupId&gt;
             &lt;artifactId&gt;${pom.artifactId}&lt;/artifactId&gt;
@@ -334,57 +350,55 @@ This is a Web application open to the Cu
 ]]></script>
 </div></div>
 
-<h3><a shape="rect" name="EJBsampleapplication-SampleDatabase"></a>Sample
Database</h3>
+<h3 id="EJBsampleapplication-SampleDatabase">Sample Database</h3>
 
-<p>The sample database that is being used to demonstrate this application is inbuilt
Derby database. The name of the sample database is <b>BankDB</b> and it consists
of three tables, CUSTOMER ,ACCOUNT and EXCHANGE_RATE. The fields for each of these tables
are described below.</p>
-<div class="table-wrap">
-<table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1"
class="confluenceTh"> Table Name </th><th colspan="1" rowspan="1" class="confluenceTh">
Fields </th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
CUSTOMER </td><td colspan="1" rowspan="1" class="confluenceTd"> customerId (PRIMARY
KEY)<br clear="none" class="atl-forced-newline">
- name </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
ACCOUNT </td><td colspan="1" rowspan="1" class="confluenceTd"> accountNumber (PRIMARY
KEY)<br clear="none" class="atl-forced-newline">
+<p>The sample database that is being used to demonstrate this application is inbuilt
Derby database. The name of the sample database is <strong>BankDB</strong> and
it consists of three tables, CUSTOMER ,ACCOUNT and EXCHANGE_RATE. The fields for each of these
tables are described below.</p>
+<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th
colspan="1" rowspan="1" class="confluenceTh"><p> Table Name </p></th><th
colspan="1" rowspan="1" class="confluenceTh"><p> Fields </p></th></tr><tr><td
colspan="1" rowspan="1" class="confluenceTd"><p> CUSTOMER </p></td><td
colspan="1" rowspan="1" class="confluenceTd"><p> customerId (PRIMARY KEY)<br clear="none"
class="atl-forced-newline">
+ name </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
ACCOUNT </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
accountNumber (PRIMARY KEY)<br clear="none" class="atl-forced-newline">
  accountType<br clear="none" class="atl-forced-newline">
  balance<br clear="none" class="atl-forced-newline">
- customerId </td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd">
EXCHANGERATE </td><td colspan="1" rowspan="1" class="confluenceTd"> rateId (PRIMARY
KEY)<br clear="none" class="atl-forced-newline">
+ customerId </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>
EXCHANGERATE </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>
rateId (PRIMARY KEY)<br clear="none" class="atl-forced-newline">
  currency<br clear="none" class="atl-forced-newline">
- rate </td></tr></tbody></table>
-</div>
+ rate </p></td></tr></tbody></table></div>
 
 <p>The CUSTOMER table stores the data related to the customers. It stores only the
identification number and and the name. ACCOUNT table has a unique account number for identification.
Account type and balance are the other information stored. Account.customerId is a foriegn
key to the Customer table which is the owner of the Account. EXCHANGERATE table has a primary
key of rateId for an identification. Each record of EXCHANGERATE has currency name and rate
paid by the bank.</p>
 
-<h2><a shape="rect" name="EJBsampleapplication-Toolsused"></a>Tools used</h2>
+<h2 id="EJBsampleapplication-Toolsused">Tools used</h2>
 
 <p>The tools used for developing and building the Banking applications are:</p>
 
-<h3><a shape="rect" name="EJBsampleapplication-ApacheDerby"></a>Apache
Derby</h3>
+<h3 id="EJBsampleapplication-ApacheDerby">Apache Derby</h3>
 
 <p>Apache Derby, an Apache DB subproject, is a relational database implemented in Java.
Its footprint is so small you can easily embed it in any Java-based solution. In addition
to its embedded framework, Derby supports a more familiar client/server framework with the
Derby Network Server.<br clear="none">
 <a shape="rect" class="external-link" href="http://db.apache.org/derby/index.html">http://db.apache.org/derby/index.html</a></p>
 
-<h3><a shape="rect" name="EJBsampleapplication-ApacheMaven2"></a>Apache
Maven 2</h3>
+<h3 id="EJBsampleapplication-ApacheMaven2">Apache Maven 2</h3>
 
 <p>Maven is a popular open source build tool for enterprise Java projects, designed
to take much of the hard work out of the build process. Maven uses a declarative approach,
where the project structure and contents are described, rather than the task-based approach
used in Ant or in traditional make files, for example. This helps enforce company-wide development
standards and reduces the time needed to write and maintain build scripts. The declarative,
lifecycle-based approach used by Maven 1 is, for many, a radical departure from more traditional
build techniques, and Maven 2 goes even further in this regard. Maven 2 can be download from
the following URL:<br clear="none">
 <a shape="rect" class="external-link" href="http://maven.apache.org">http://maven.apache.org</a></p>
 
 <p><a shape="rect" href="#EJBsampleapplication-top">Back to Top</a></p>
 
-<h1><a shape="rect" name="EJBsampleapplication-Configuring%2CBuildingandDeployingtheSampleApplication"></a>Configuring,
Building and Deploying the Sample Application <a shape="rect" name="EJBsampleapplication-configure"></a></h1>
+<h1 id="EJBsampleapplication-Configuring,BuildingandDeployingtheSampleApplicationconfigure">Configuring,
Building and Deploying the Sample Application <span class="confluence-anchor-link" id="EJBsampleapplication-configure"></span></h1>
 
 <p>Download the bank application from the following link:<br clear="none">
-<a shape="rect" href="ejb-sample-application.data/bank.zip?version=1&amp;modificationDate=1190970700000">Bank</a></p>
+<a shape="rect" href="ejb-sample-application.data/bank.zip?version=1&amp;modificationDate=1190970700000&amp;api=v2">Bank</a></p>
 
-<p>After decompressing the given file, the <b>bank</b> directory will be
created.</p>
+<p>After decompressing the given file, the <strong>bank</strong> directory
will be created.</p>
 
-<h2><a shape="rect" name="EJBsampleapplication-SourceCode"></a>Source Code</h2>
+<h2 id="EJBsampleapplication-SourceCode">Source Code</h2>
 
 <p>You can checkout the source code of this sample from SVN:</p>
 
 <p>svn checkout <a shape="rect" class="external-link" href="http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/bank">http://svn.apache.org/repos/asf/geronimo/samples/trunk/samples/bank</a></p>
 
-<h2><a shape="rect" name="EJBsampleapplication-Configuring"></a>Configuring</h2>
+<h2 id="EJBsampleapplication-Configuring">Configuring</h2>
 
 <p>Configuration of the application consists of creating the database and defining
the connection pool to access it.</p>
 
-<h3><a shape="rect" name="EJBsampleapplication-CreatingandPopulatingDatabase"></a>Creating
and Populating Database</h3>
+<h3 id="EJBsampleapplication-CreatingandPopulatingDatabase">Creating and Populating
Database</h3>
 
-<p>After starting Apache Geronimo log into the console and follow the given steps to
create the <b>BankDB</b>.</p>
+<p>After starting Apache Geronimo log into the console and follow the given steps to
create the <strong>BankDB</strong>.</p>
 <div class="preformatted panel" style="border-style: solid;border-width: 1px;"><div
class="preformattedHeader panelHeader" style="border-bottom-width: 1px;border-bottom-style:
solid;"><b>BankDB.sql</b></div><div class="preformattedContent panelContent">
 <pre>CREATE TABLE Customer(
 	customerId VARCHAR(255) PRIMARY KEY,
@@ -414,33 +428,32 @@ INSERT INTO ExchangeRate(rateId,currency
 INSERT INTO ExchangeRate(rateId,currency,rate) VALUES('003','SLR',99.18);
 </pre>
 </div></div>
-<ol><li>Select <b>DB Manager</b> link from the <b>Console Navigation</b>
in the left.</li><li>Give the database name as <b>BankDB</b> and click
<b>Create</b> button.</li><li>Select <b>BankDB</b> to
the <b>Use DB</b> field.</li><li>Open <b>BankDB.sql</b>
in the <b>bank</b> directory from a text editor.</li><li>Paste the
content <b>BankDB.sql</b> to the <b>SQL Commands</b> text area and
press <b>Run SQL</b> button.</li></ol>
+<ol><li>Select <strong>DB Manager</strong> link from the <strong>Console
Navigation</strong> in the left.</li><li>Give the database name as <strong>BankDB</strong>
and click <strong>Create</strong> button.</li><li>Select <strong>BankDB</strong>
to the <strong>Use DB</strong> field.</li><li>Open <strong>BankDB.sql</strong>
in the <strong>bank</strong> directory from a text editor.</li><li>Paste
the content <strong>BankDB.sql</strong> to the <strong>SQL Commands</strong>
text area and press <strong>Run SQL</strong> button.</li></ol>
 
 
-<h2><a shape="rect" name="EJBsampleapplication-Building"></a>Building</h2>
+<h2 id="EJBsampleapplication-Building">Building</h2>
 
-<p>Use a command prompt to navigate into the <b>bank</b> directory and
just give <b>mvn install site</b> command to build. It will create the <b>bank-ear-2.0-SNAPSHOT.ear</b>
under the <b>bank</b> folder. Now, you are ready to deploy bank application in
the Geronimo Application server.</p>
+<p>Use a command prompt to navigate into the <strong>bank</strong> directory
and just give <strong>mvn install site</strong> command to build. It will create
the <strong>bank-ear-2.0-SNAPSHOT.ear</strong> under the <strong>bank</strong>
folder. Now, you are ready to deploy bank application in the Geronimo Application server.</p>
 
-<h2><a shape="rect" name="EJBsampleapplication-DeployingtheApplication"></a>Deploying
the Application</h2>
+<h2 id="EJBsampleapplication-DeployingtheApplication">Deploying the Application</h2>
 
 <p>Deploying sample application is pretty straight forward as we are going to use the
Geronimo Console.</p>
-<ol><li>Scroll down to <b>Deploy New</b> from the <b>Console
Navigation</b> panel.</li><li>Load <b>bank-ear-2.0-SNAPSHOT.ear</b>
from <b>bank</b> folder in to the <b>Archive</b> input box.</li><li>Press
<b>Install</b> button to deploy application in the server.</li></ol>
+<ol><li>Scroll down to <strong>Deploy New</strong> from the <strong>Console
Navigation</strong> panel.</li><li>Load <strong>bank-ear-2.0-SNAPSHOT.ear</strong>
from <strong>bank</strong> folder in to the <strong>Archive</strong>
input box.</li><li>Press <strong>Install</strong> button to deploy
application in the server.</li></ol>
 
 
 <p><a shape="rect" href="#EJBsampleapplication-top">Back to Top</a></p>
 
-<h2><a shape="rect" name="EJBsampleapplication-BankingWebApplication"></a>Banking
Web Application</h2>
+<h2 id="EJBsampleapplication-BankingWebApplication">Banking Web Application</h2>
 
 <p>To test the sample web application open a browser and type <a shape="rect" class="external-link"
href="http://localhost:8080/Bank" rel="nofollow">http://localhost:8080/Bank</a>.
It will forward you to the index page of banking application which has direct links to the
view customer and exchange rate information. To view the list of account information of each
customer, provide a relavant customer id in the DB. Exchange rate page will display list of
all currencies in the exchange rate table. (Note that 'Bank' is case-sensitive)<br clear="none">
-<span class="image-wrap" style="display: block; text-align: center"><img src="ejb-sample-application.data/bank.bmp"
style="border: 0px solid black"></span></p>
+<img class="confluence-embedded-image image-center" src="https://cwiki.apache.org/confluence/download/attachments/60015/bank.bmp?version=1&amp;modificationDate=1182933647000&amp;api=v2"
data-image-src="/confluence/download/attachments/60015/bank.bmp?version=1&amp;modificationDate=1182933647000&amp;api=v2"></p>
 
-<h1><a shape="rect" name="EJBsampleapplication-Summary"></a>Summary <a
shape="rect" name="EJBsampleapplication-summary"></a></h1>
+<h1 id="EJBsampleapplication-Summarysummary">Summary <span class="confluence-anchor-link"
id="EJBsampleapplication-summary"></span></h1>
 
 <p>This article has shown you how to use the EJB features of the Apache Geronimo. It
has provided step-by-step instructions to build an application, deploy and run it to elaborate
those features.</p>
 
 <p>Following are some of the highlights of the article.</p>
-<ul><li>Apache Geronimo is a J2EE 1.5 Certified application server and it provides
all the necessary features to Enterprise applications.</li><li>Create and configure
Session and Entity Beans.</li><li>Access defined enterprise level services by
different sorts of clients.</li></ul>
-</div>
+<ul><li>Apache Geronimo is a J2EE 1.5 Certified application server and it provides
all the necessary features to Enterprise applications.</li><li>Create and configure
Session and Entity Beans.</li><li>Access defined enterprise level services by
different sorts of clients.</li></ul></div>
         </div>
 
         



Mime
View raw message