    All Examples  All EJB Examples

# Packages examples.ejb.extensions.finderEnumeration

## Enterprise JavaBean entity bean example packages and classes
demonstrating finder enumerations

- Client applications
    Client (client application documentation and source)

- Deployment
    ejb-jar.xml
    weblogic-ejb-jar.xml

- Interfaces
    Account (remote interface documentation and source)
    AccountHome (home interface documentation and source)

- Server (EJBean)
    AccountBean (EJBean documentation and source)

# about these 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.

# how to use this example

To get the most out of this example, first read through the source code files. In particular, start with the XML deployment files to find the general structure of the EJB and which classes are used for the different objects and interfaces. Then look at Client.java to see how the application works.

After you have become familiar with the code and deployment parameters:

1. Build the examples
2. Set your environment
3. Run the examples

## Build the examples

Set up your development environment as described in Setting your development environment.

We provide separate build scripts for Windows NT and UNIX:

- build.cmd for Windows NT

- build.sh for UNIX

These scripts build the example and place the files in the correct locations:

- Client files: in /myserver/clientclasses
- EJBean: in /myserver/ejb_extensions_finderEnumeration.jar

## Set your environment

1. Setup a connection pool in the weblogic.properties file.

   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=none

   You 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,\

2. Add an access control list (ACL) for users of the pool:

         # 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.

## Run the examples

1. Start the WebLogic Server.

   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.

2. Deploy the example EJB. If you have not registered the EJB in your weblogic.properties file, deploy it from the command line:

       $ java weblogic.deploy deploy system_password finderEnum c:\weblogic\myserver\ejb_extensionsfinderEnumeration.jar

3. Set up your client as described in Setting your development environment, and then run the client by entering:

       $ java examples.ejb.extensions.finderEnumeration.Client

# there's more

Read more about EJB in BEA WebLogic Server Enterprise Java Beans.

Copyright © 2000 BEA Systems, Inc. All rights reserved.

Last updated 03/22/2000