Title: Title: Arial 28pt.
1 J2EE Entity Beans and CMP in EAServer using
Sybase ASA
Robert Nicholson IT Programmer /
Analyst rnichols_at_usoe.k12.ut.us August 17, 18
2004
2Instructor
- Robert Nicholson IT Programmer / Analyst
- rnichols_at_usoe.k12.ut.us
- Utah State Office of Education
3Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
4Assumptions
- You have installed
- Sybase EAServer 5.x
- Borland JBuilder 10 Enterprise
- Sybase ASA 8
- Borland JBuilder 10 EAServer plug-in
- http//www.sybase.com/detail?id1028173install
- You have some experience working with JBuilder 10
- You are familiar with the EAServer Manager
Interface
5Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
6EJB / EAServer Structure
7Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
8JBuilder to ASA Configuring Data Sources
- Add JConnect5.5 to the database section of the
Tools Menu gt Enterprise Setup - Configure a new Database URL using the Database
Pilot on the Tools Menu (optional) - Driver com.sybase.jdbc2.jdbc.SybDriver
- URL jdbcsybaseTdslocalhost2638
- Note Other databases can be used if the Driver,
URL, and other parameters are known
9Database Pilot
10Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
11Create the JBuilder Project Step 1
12Create the JBuilder Project Step 2
13Create the JBuilder Project Step 3
14Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
15Steps Used in Creating the EJB
- Create an EJB Module
- Import Schema from Database
- Use imported schema structure to Create CMP 2.0
Entity Bean - Add an overloaded ejbCreate() method
16Creating the EJB Module Step 1
17Creating the EJB Module Step 2
18Import Schema From ASA Database
- If using Data Pilot
- Select Choose Existing Connection
- Choose the connection from the list
- Verify schema properties
- Take note of JNDI name
- Used for CMP in EAServer
- Should match Connection Cache name in EAServer
19Creating the CMP Entity Bean
- Using a table in the DB schema / Structure Pane
- Create CMP 2.0 Entity Bean (EJB)
20CMP Entity Bean Properties
- Using the EJB Designer
- Specify the JNDI name
- Update Class Definitions specifying correct
package name - Select Local/Remote interfaces
21CMP Entity Bean Properties
- Specify the JNDI name using the DD Editor
22CMP Entity Bean Properties
- Select Local/Remote Interfaces
- Update Class Definitions specifying correct
package name
23CMP Entity Bean New ejbCreate() Method
- Add an overloaded ejbCreate() method
- In EJB Designer right-click bean
- Select Add gt ejbCreate
24CMP Entity Bean New ejbCreate() Method
- In EJB Designer
- Rename new method to ejbCreate
- Add method parameters
- Method logic follows
25Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
26Create Web Application / EJB Client
- Add new Web Module (WAR)
- Change name on step 2
- Change standards on step 2 (if desired)
- Accept all other defaults
27Add new Web Module (WAR) Step 1
28Add New Web Module (WAR) Step 2
29Add New Web Module (WAR) Step 3
30Add JSP Page to Web Module
- Add a new JSP to the Web Module
- Change name on step 1
- Accept all other defaults
31Add New JSP (Sample Code)
32Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
33Build Deploy EJB to EAServer
- Select Rebuild
- Select Deploy Options
- Select Deploy
34Build Deploy Web Module to EAServer
- Select Rebuild
- Select Deploy Options
- Select Deploy
35Course Overview
- Assumptions
- EAServer Structure
- JBuilder to ASA Connection
- Creating the JBuilder Project
- Creating the EJB
- Creating the Web Application Client (WAR)
- Build Deploy
- Run Application
36Run Application
- Open a web browser
- Go to the application URL
- http//mymachinename8080/myWebModule/myjsp.jsp
37Demo Survey Application
38Questions