📄 test.java
字号:
package test;
import javax.naming.Context;
import javax.naming.InitialContext;
import javax.naming.NamingException;
import service.CustomerMgmtBeanRemote;
import entity.Customer;
public class Test {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
try {
Context ctx = new InitialContext();
CustomerMgmtBeanRemote cmbr =
(CustomerMgmtBeanRemote) ctx.lookup("CustomerMgmtBean3/remote");
Customer c = new Customer();
c.setName("c1");
c.setCity("bj");
c.setStreet("ca");
cmbr.save(c);
Customer c2 = cmbr.find("c1");
System.out.println(c2.getCity());
} catch (NamingException e) {
// TODO Auto-generated catch block
System.out.println(e.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -