All Examples All EJB Examples
These examples are two packages that demonstrate an Enterprise JavaBean. Please run these examples before attempting to create your own Enterprise JavaBeans, as they will show you the different steps involved. You should also have run our basic examples to gain an introduction to EJBeans.
This example demonstrates the use of finder enumerations for bean-managed entity EJBs. Using finder enumerations generally provides improved performance for EJB access, because EJB data is read from the database along with the primary key values in the finder. See WebLogic Server EJB Design and Development for more information on finder enumerations.
After you have become familiar with the code and deployment parameters:
We provide separate build scripts for Windows NT and UNIX:
These scripts build the example and place the files in the correct locations:
For your convenience, a template is included in the file; search for "weblogic.jdbc.connectionPool.demoPool", and uncomment and edit the appropriate lines:
# You can use this connection pool with any of the EJBean examples. # Uncomment to use: weblogic.jdbc.connectionPool.demoPool=\ url=jdbc:cloudscape:demo,\ driver=COM.cloudscape.core.JDBCDriver,\ initialCapacity=1,\ maxCapacity=2,\ capacityIncrement=1,\ props=user=none;password=none;server=noneYou can use this pool for Cloudscape. For other databases, you'll need to set an appropriate url and driver, such as
url=jdbc:weblogic:oracle,\ driver=weblogic.jdbc.oci.Driver,\
# Add an ACL for the connection pool: weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone
If you need more information about how to use connection pools, read Using WebLogic JDBC: Using connection pools.
If you're starting the Server from the command line, you'll need to add an entry such as c:/weblogic/eval/cloudscape/lib/cloudscape.jar to the Java system classpath before starting the server, as described in the Administrators Guide Setting up and starting the WebLogic Server.
You can check that the EJBean has been deployed correctly either by checking the server command line window, or by opening the Console and examining "EJB" under the "Distributed objects"; you should see isModified.AccountHome and isModifiedBeanManaged.AccountHome deployed, and can monitor their activity.
$ java weblogic.deploy deploy system_password finderEnum c:\weblogic\myserver\ejb_extensionsfinderEnumeration.jar
$ java examples.ejb.extensions.finderEnumeration.Client
Copyright © 2000 BEA Systems, Inc. All rights reserved.
Last updated 03/22/2000