Milestone 3. due May 18, 11:59pm
In this lab you'll implement and use container-based entity beans. More specifically the following example demonstrates:
Part 1. You will set up a data source. Then you will deploy and run an example of entity beans. The source code is in
/stage/classes/current/51024-1/pub/EJB/Product/.
The bean client creates
6 separate products (beans) and retrieves back some of them. Then it removes
them all.
Steps:
Create a data source with a name that includes your CS login name; for example: "myloginDataSource". Create a JNDI name for your data source (for example: myloginJDBCTxDataSource). Set up a JDBC connection to the Oracle database server using your Oracle account. The name of the database is cs51024. You can also see this by typing echo $ORACLE_DB.
Documentation on JDBC data source configuration: Read the generated configuration file in $WL_HOME/samples/domains/wl_server/config/jdbc.If your data source name is "myloginDataSource", your JDBC data source configuration file should have a name like myloginDataSource-????-jdbc.xml.
Read your server configuration file config.xml. What do you see? Where is your data source? Where are the deployed EJBs?
this will create a jar file ejb_product.jar (in $WL_HOME/samples/domains/wl_server/autodeploy/) that contains all compiled code needed for your bean. It will also compile your client and put all .class file in the $CLIENT_CLASSES directory ( this is already in your CLASSPATH). Please take a look at the Makefile to understand what's going on. The build process is explained in more detail here.
Notice in your deployment descriptors weblogic-cmp-rdbms-jar.xml the name of the table that will be used in this example. Please create this table with:
create table Products (name varchar(50), productid varchar(50), description varchar(100), basePrice Integer)
java -Djava.naming.factory.initial=weblogic.jndi.WLInitialContextFactory -Djava.naming.provider.url=t3://localhost:7001 examples.product.ProductClient
What did change in the EJB monitor of the console?Part 2
Work on Milestone 3: Implement your own entity beans that should take you
closer to completing the final project.