coffeesclient.java

来自「JDBC Book Code Examples」· Java 代码 · 共 35 行

JAVA
35
字号
import java.sql.*;import javax.sql.*;import javax.naming.*;import javax.ejb.*;import javax.rmi.*;class CoffeesClient {  public static void main(String[] args) {    try {      Context ctx = new InitialContext();	  Object obj = ctx.lookup("ejb/Coffees");      CoffeesHome chome = (CoffeesHome)			PortableRemoteObject.narrow(obj, CoffeesHome.class);      Coffees coffees = chome.create();	        RowSet rset = coffees.getCoffees();      // display the coffees for sale      // get user input from GUI            coffees.placeOrder("Colombian", 3, "12345");            // repeat until user quits    }    catch (Exception e) {      System.out.print(e.getClass().getName() + ":");      System.out.println(e.getMessage());    }  }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?