Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Danielle Daniels   on Nov 25 In Java Category.

  
Question Answered By: Bonifaco Garcia   on Nov 25


In bmp  these things such as getConnection(), createStatement(),
executeQuery() and ... are used in ejbLoad().
Instead in cmp  persistent fields for EJBs are included in a DD file which
in WebLogic is ejb-jar.xml
for example:


<cmp-field>
<field-name>name</field-name>
</cmp-field>
<cmp-field>
<field-name>age</field-name>
</cmp-field>
...

Plus some little things in weblogic-ejb-jar.xml
JDBC stuff such as datasource, table and also mapping between the fields
defined in ejb-jar.xml and the actual attributes of the underlying table
goes into weblogic-ejb-jar.xml

...
<ejb-name>MyEJB</ejb-name>
<data-source-name>MyDS</data-source-name>
<table-name>MyCustomers</table-name>
<field-map>
<cmp-field>name</cmp-field>
<dbms-column>cust_name</dbms-column>
</field-map>
<field-map>
<cmp-field>age</cmp-field>
<dbms-column>cust_age</dbms-column>
</field-map>

Share: