一个简单的EJB实例.用DB2连接.JSP页面.很好用.供大家学习
源代码在线查看: locationbeaninjectorimpl_176caeeb.java
package salesdb.websphere_deploy.DB2UDBNT_V8_1; /** * LocationBeanInjectorImpl_176caeeb */ public class LocationBeanInjectorImpl_176caeeb implements salesdb.websphere_deploy.LocationBeanInjector_176caeeb { /** * ejbCreate */ public void ejbCreate(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.ConcreteLocation_176caeeb concreteBean=(salesdb.ConcreteLocation_176caeeb)cb; record.set(0,concreteBean.getCity()); record.set(1,concreteBean.getState()); record.set(2,concreteBean.getZipcode()); record.set(3,concreteBean.getAreacode()); } /** * ejbStore */ public void ejbStore(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.ConcreteLocation_176caeeb concreteBean=(salesdb.ConcreteLocation_176caeeb)cb; record.set(0,concreteBean.getCity()); record.set(1,concreteBean.getState()); record.set(2,concreteBean.getZipcode()); record.set(3,concreteBean.getAreacode()); } /** * ejbRemove */ public void ejbRemove(com.ibm.ws.ejbpersistence.beanextensions.ConcreteBean cb, javax.resource.cci.IndexedRecord record) { salesdb.ConcreteLocation_176caeeb concreteBean=(salesdb.ConcreteLocation_176caeeb)cb; record.set(2,concreteBean.getZipcode()); } /** * ejbFindByPrimaryKey */ public void ejbFindByPrimaryKey(Object pkeyObject, javax.resource.cci.IndexedRecord record) { salesdb.LocationKey pkey=(salesdb.LocationKey)pkeyObject; record.set(0,pkey.zipcode); } /** * findLocationfkByLocationfkPurchaseInverseKey_Local */ public void findLocationfkByLocationfkPurchaseInverseKey_Local(salesdb.PurchaseKey fkey, javax.resource.cci.IndexedRecord record) { record.set(0,fkey.purchaseid); } }