All Examples All EJB Examples
This example includes a read-only entity EJB called Stock and a read-write entity EJB named StockWriter. Both EJBs work together to provide "read-mostly" access to a set of data. See Setting the cache strategy for entity EJBs for more information about the read-only and read-write strategies.
After you are familiar with the classes and deployment files:
We provide separate build scripts for Windows NT and UNIX:
These scripts will 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 EJB 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
# 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.
$ java weblogic.deploy deploy system_password readmostly c:\weblogic\myserver\ejb_extensions_readMostly.jar
$ java examples.ejb.extensions.readMostly.Client
If you're not running the WebLogic Server with its default settings, you will have to run the client using:
$ java examples.ejb.extensions.readMostly.Client "t3://WebLogicURL:Port"
Parameters are optional, but if any are supplied, they are interpreted in this order:
Copyright © 2000 BEA Systems, Inc. All rights reserved.
Last updated 03/22/2000