5011b2af418b001c1f62b79abc590043
来自「这是通过ejb实现从服务器上获取当前时间」· 代码 · 共 34 行
TXT
34 行
package test;
import java.util.Calendar;
import java.util.Properties;
import javax.naming.Context;
public class TestClient {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String url = "t3://localhost:7001";
// Hashtable env = new Hashtable();
// env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory");
// env.put(Context.PROVIDER_URL, url);
Properties properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY,
"weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
Test my = TestUtil.getHome(properties).create();
Calendar calBase = Calendar.getInstance();
calBase.set(2007, 11, 27);
int weekBase = calBase.get(Calendar.DAY_OF_YEAR);
int weekCurrent = my.foo("").get(Calendar.DAY_OF_YEAR);
int weekCount = weekCurrent - weekBase;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?