All Examples All EJB Examples
Enterprise JavaBean sequence example
packages and classes
about this example
This example consists of two packages that demonstrate creating
unique identication numbers using Enterprise JavaBeans.
These techniques could be used when creating entity beans,
which require a unique primary key.
Please run these examples before attempting to
create your own Enterprise JavaBeans, as it will show you the
different steps involved.
Package examples.ejb.sequence.jdbc
The jdbc example demonstrates:
- Using an entity bean that automatically generates
its primary key by calling directly
to a database using a connection pool and JDBC
- Accessing properties in the Deployment Descriptor using a hashtable
- Client application
Note that this application of sequence scales
by caching a range of unique IDs as class attributes of the bean.
The bean only goes to the database for
an ID when the range is exhausted.
Performance could be further improved by using a stored procedure
on the database to generate the primary key instead of the procedure
contained in the EJBean.
Package examples.ejb.sequence.oracle
The oracle example demonstrates:
- Using an entity bean that automatically generates
its primary key by calling directly
to a database Oracle sequence using a connection pool and JDBC
- Accessing properties in the Deployment Descriptor using a hashtable
- Client application
Note that this application of sequence scales
by caching a range of unique IDs as class attributes of the bean.
The bean only goes to the database for
an ID when the range is exhausted.
Performance could be further improved by using a stored procedure
on the database to generate the primary key instead of the procedure
contained in the EJBean.
how to use this example
See the individual examples
(jdbc
and
oracle) for instructions on building and running each example.
there's more
Read more about EJB in the Developers Guide,
Using
WebLogic Enterprise JavaBeans.
Copyright © 1997-1999 BEA Systems, Inc.
All rights reserved.
Last updated
07/23/1999