- Configure JCodeBox
Configure JCodeBox system options such as the default DataSource JNDI name. For further details on configuring system
options please see chapter 18. Appendix C - JCodeBox configuration.
- Configure databases
- In the main JCodeBox window, right mouse click on the Database Drivers node and select Add Driver...
- Complete the Add Driver dialog
- Restart JCodeBox
Once you have configured your JDBC driver(s) you can create connections to your databases. For further
details on configuring JDBC drivers and creating connections please see chapter 16. Appendix A - Database configuration.
- Add a connection
- In the main JCodeBox window, right mouse click on the Database Driver you created in the previous step
and select Add Connection...
- Complete the Add Connection dialog
- Double click on the connection to list the catalogs/schemas available in the database.
- Open the define application dialog
- Right mouse click on the catalog/schema you would like to use and select
Generate Application->J2EE Enterprise Application 1.3
Note
If you decide not to configure database support in JCodeBox at this time, you can still build and deploy J2EE Applications
by selecting Generate->J2EE Enterprise Application from the main menu
- Enter application settings
- Enter the application name (defaults to the name you entered in the system options dialog)
- Enter the base package name (defaults to the name you entered in the system options dialog)
- Enter the target output directory (defaults to the directory you entered in the system options dialog)
- Enter a datasource JNDI name (Important this will be inherited by all subsequently created entity beans - defaults to the name you entered in the system options dialog)
- Select your target application server
- Select your target database
Note
Make sure you have previously configured the datasource JNDI name in your target application server.
- Define entities
If you are defining an application from a database schema/catalog:
- Right mouse click on the EIS Tier and choose Add Multiple Database Entities ...
- Double click on the TABLES node
- Select one or more tables and click OK (make sure all selected tables have primary keys defined in the database)
- Click OK
If you are defining an application with entities defined in the JCodeBox GUI:
- Right mouse click on the EIS Tier and choose Add Manual Entity ...
- Define the name, primary key fields and Data fields for your entity
- Click OK
- Define as many entities as your application requires.
- Define business objects
To define an entity EJB:
- Right mouse click on the Business Tier and choose Add Multiple BMP/CMP EJBs
- Select the entities (configured in the previous step) these EJBs will be based on
- Click OK
To define a session EJB:
- Right mouse click on the Business Tier and choose Add Stateless/Stateful Session EJB/Facade
- Enter your business methods on the Code tab
- Click OK
To define a message driven bean:
- Right mouse click on the Business Tier and choose Add Message Driven Bean/Facade
- Enter your business logic in the onMessage method (on the Code tab)
- Click OK
- Define view sets
- Right mouse click on the Web Tier and choose Add Multiple View sets ...
- Select the Business Objects you would like views created for.
- Click OK
- Generate, build and deploy
- Click Create in the Enterprise Application dialog
- Select all of the build options (pre-process, generate, compile, package and deploy)
- Click OK
- If any resources need to be configured in your application server prior to deployment they will be displayed in a dialog. Click OK on this dialog when the resources have been configured.
- Finish
If your application server is correctly configured, JCodeBox will generate, build and deploy your application.
If you selected the Launch Browser after deploy option in system options, JCodeBox will open a browser displaying
your deployed J2EE Application.
All of the java source code (with javadoc tags), deployment descriptors, ANT build scripts, jar files, a readme file,
etc can be found in the target output directory you entered in the Enterprise Application settings dialog.
This tutorial has merely scratched the surface of the rich functionality available in JCodeBox. Please read the rest
of the user guide for details on more advanced features including adding relationships, adding J2EE patterns, defining
finders/selects, adding business methods and much much more.