Java Data Objects (JDO)
EJB and JDO
Session EJB Facade to JDO Objects
Gopalan Suresh Raj
work with any of these samples, you will need the
.........................................JDK 1.2 or higher (I use JDK 1.3.1)
.........................................PE:JTM - The Productivity Environment for JavaTM (from HYWY Software Corporation)
.........................................BEA Weblogic 7.0 (beta) J2EE Compliant Application Server
|Note: This article assumes that the reader has already created the simple bank project using PE:J and JDO.|
Before you start off, create a jar file of all the files in the enhanced folder, name the jar file bank.jar and place it in the enhanced folder (for me the enhanced folder is C:\run\projects\bank\enhanced\). My bank.jar contains all the .class, .jdo, and .map files present in the C:\run\projects\bank\enhanced\com\hywy\samples\bank\ folder.
|Session EJB Facade to JDO Objects|
Build the Sample Application.
[delete] Deleting directory C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build
[delete] Deleting directory C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\dist
[mkdir] Created dir: C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build
[mkdir] Created dir: C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build\META-INF
[mkdir] Created dir: C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\dist
[copy] Copying 2 files to C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build\META-INF
[javac] Compiling 3 source files to C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build
[mkdir] Created dir: C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build\com\hywy\samples\bank
[copy] Copying 10 files to C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\build\com\hywy\samples\bank
[jar] Building jar: C:\run\projects\bank\enhanced\com\hywy\samples\ejb20\session\stateless\dist\teller_session.jar
[java] <Jun 2, 2002 2:02:48 PM EDT> <Warning> <EJB> <010054> <EJB Deployment: Teller has a class com.hywy.samples.ejb20.session.stateless.TellerHome
which is in the classpath. This class should only be located in the ejb-jar file.>
[java] <Jun 2, 2002 2:02:48 PM EDT> <Warning> <EJB> <010054> <EJB Deployment: Teller has a class com.hywy.samples.ejb20.session.stateless.Teller whi
ch is in the classpath. This class should only be located in the ejb-jar file.>
[java] ejbc successful.
[ear] Building ear: C:\bea\weblogic700b\samples\server\config\examples\applications\teller_session.ear
[javac] Compiling 2 source files to C:\bea\weblogic700b\samples\server\config\examples\applications\examplesWebApp\WEB-INF\classes
[javac] Compiling 3 source files to C:\bea\weblogic700b\samples\server\config\examples\clientclasses
Total time: 8 seconds
Before moving on,
On my system, all my projects are placed in a user directory named "run" which is created off the C: drive. My PE:J product is installed off my C: drive. My BEA Weblogic Application Server is installed off the C: drive. You may have make appropriate modifications based on your installation environment.
Copy the \.pej\ folder from C:\run\projects\bank\bank_ObjectEditor\ to the C:\bea\weblogic700b\samples\server\config\examples\ folder. You will also have to copy the system.properties file from the C:\PEJ\.pej\ folder to the C:\bea\weblogic700b\samples\server\config\examples\.pej\ folder.
Run the Sample Application.
Before running the client, make sure the Application Server is up and running. I had to modify the Weblogic startup script to add the pej.jar and the bank.jar files to the Application Server's CLASSPATH. The modified Examples Server batch file is available here. You may have to modify it based on your environment.
C:\bea\weblogic700b\samples\server\config\examples\clientclasses>%JAVA_HOME%/bin/java -classpath .;C:/PEJ/lib/j2ee.jar;C:\bea\weblogic700b\server\lib\weblogic.jar;C:\PEJ\lib\pej.jar com.hywy.samples.ejb20.session.stateless.Client "t3://localhost:7001/TellerHome"
Creating a Teller
Create Checking Account for Gopalan Suresh Raj
Create Checking Account for Athul Suresh Raj
Create Savings Account for Gopalan Suresh Raj
Create Savings Account for Athul Suresh Raj
The size of checkingAccountList is :4
List of Checking Accounts
Checking Account Number :9345903153152
Checking Account Number :9483342106624
Checking Account Number :9620781060096
Checking Account Number :9758220013568
The size of savingsAccountList is :4
List of Savings Accounts
Savings Account Number :9345886375936
Savings Account Number :9483325329408
Savings Account Number :9620764282880
Savings Account Number :9758203236352
Delete Checking Account Number :9345903153152
The size of checkingAccountList is now :3
Delete Savings Account Number :9345886375936
The size of savingsAccountList is now :3
Transfer Money - 100 from Checking Account :9483342106624 to Savings Account :9483325329408
The Money Transfer was a SUCCESS
Removing the teller
You can download the entire enhanced folder from here.
click here to go to
My JDO HomePage...
click here to go
My Advanced Java Tutorial Page...
|About the Author...|
|Gopalan Suresh Raj is a Software Architect, Developer and an active Author. He has co-authored a number of books including "Professional JMS", "Enterprise Java Computing-Applications and Architecture" and "The Awesome Power of JavaBeans". His expertise spans enterprise component architectures and distributed object computing. Visit him at his Web Cornucopia© site (http://gsraj.tripod.com/) or mail him at firstname.lastname@example.org.|
This site was developed and is maintained by Gopalan Suresh Raj
This page has been visited times since February 26,2002.
Last Updated : Feb 26, 2002
All products and companies mentioned at this site are trademarks of their respective owners.