一个简单的EJB实例.用DB2连接.JSP页面.很好用.供大家学习
源代码在线查看: purchasebeaninjectorimpl_e813240d.java
package salesdb.websphere_deploy.DB2UDBNT_V8_1; /** * PurchaseBeanInjectorImpl_e813240d */ public class PurchaseBeanInjectorImpl_e813240d implements salesdb.websphere_deploy.PurchaseBeanInjector_e813240d { /** * ejbCreate */ public void ejbCreate(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.LocationKey tempLocationKey; salesdb.ItemKey tempItemKey; salesdb.ConcretePurchase_e813240d concreteBean=(salesdb.ConcretePurchase_e813240d)cb; record.set(0,concreteBean.getPurchaseid()); record.set(1,concreteBean.getTimestmp()); tempItemKey= concreteBean.getItemfkKey(); if(tempItemKey==null) record.set(2,null); else record.set(2,tempItemKey.itemid); tempLocationKey= concreteBean.getLocationfkKey(); if(tempLocationKey==null) record.set(3,null); else record.set(3,tempLocationKey.zipcode); } /** * ejbStore */ public void ejbStore(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.LocationKey tempLocationKey; salesdb.ItemKey tempItemKey; salesdb.ConcretePurchase_e813240d concreteBean=(salesdb.ConcretePurchase_e813240d)cb; record.set(0,concreteBean.getPurchaseid()); record.set(1,concreteBean.getTimestmp()); tempItemKey= concreteBean.getItemfkKey(); if(tempItemKey==null) record.set(2,null); else record.set(2,tempItemKey.itemid); tempLocationKey= concreteBean.getLocationfkKey(); if(tempLocationKey==null) record.set(3,null); else record.set(3,tempLocationKey.zipcode); } /** * ejbRemove */ public void ejbRemove(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.ConcretePurchase_e813240d concreteBean=(salesdb.ConcretePurchase_e813240d)cb; record.set(0,concreteBean.getPurchaseid()); } /** * ejbFindByPrimaryKey */ public void ejbFindByPrimaryKey(Object pkeyObject, javax.resource.cci.IndexedRecord record) { salesdb.PurchaseKey pkey=(salesdb.PurchaseKey)pkeyObject; record.set(0,pkey.purchaseid); } /** * findItemfkPurchaseInverseByItemfkKey_Local */ public void findItemfkPurchaseInverseByItemfkKey_Local(salesdb.ItemKey fkey, javax.resource.cci.IndexedRecord record) { record.set(0,fkey.itemid); } /** * findLocationfkPurchaseInverseByLocationfkKey_Local */ public void findLocationfkPurchaseInverseByLocationfkKey_Local(salesdb.LocationKey fkey, javax.resource.cci.IndexedRecord record) { record.set(0,fkey.zipcode); } }