본문 바로가기

IT-Consultant

EJB 사용하기( Client 입장에서.. )

Hashtable env = new Hashtable(5);
env.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
env.put(Context.PROVIDER_URL, "t3://was ip:7001");
try {
Context ic = new InitialContext(env); 

ExVocUnityServiceHome home = (ExVocUnityServiceHome) PortableRemoteObject.narrow ( ic.lookup("ejb/ExVocUnityService"), ExVocUnityServiceHome.class);
ExVocUnityService service = (ExVocUnityService) PortableRemoteObject.narrow (home.create(), ExVocUnityService.class);
int result = service.createOnlineTrendInfomation(map);
}

참고 문서 : http://www.google.co.kr/url?sa=t&source=web&cd=1&ved=0CC8QFjAA&url=http%3A%2F%2Fwww.phplab.co.kr%2Fcms%2Fboard%2Fdownload.php%3Ffilename%3Dejb%25B0%25AD%25C1%25C2.pdf&ei=DHx4TcSJG4HKcYz8_K0E&usg=AFQjCNEUfBOkRm8oTWQp3s3go1CHefc6hg