inventorywebimpl.java
来自「一个优秀的供应商管理系统」· Java 代码 · 共 31 行
JAVA
31 行
package apusic.myshop.inventory.web;import java.rmi.RemoteException;import javax.ejb.FinderException;import apusic.myshop.util.Debug;import apusic.myshop.util.EJBUtil;import apusic.myshop.inventory.ejb.InventoryHome;import apusic.myshop.inventory.ejb.Inventory;public class InventoryWebImpl { public InventoryWebImpl() { } public int getInventory(String productId){ try{ InventoryHome inventoryHome = EJBUtil.getInventoryHome(); Inventory inventory = inventoryHome.findByProductId(productId); return inventory.getQty(); } catch (RemoteException re) { Debug.println("InventoryBean: Unable to locate invetory for item " + productId); } catch (FinderException fe) { Debug.println("InventoryBean: Unable to locate invetory for item " + productId); } return 0; }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?