最好给个调用的代码,多谢!
解决方案 »
- 01:58:52,718 WARN org.hibernate.util.JDBCExceptionReporter:100 - SQL Error: 114
- 线程与进程有那些区别?又有那些联系额
- SSH中传值到jsp页面后,使用iterator输出失败--在线求解答!
- 在MyEclipse中修改jsp的版本
- dom4j 如何得到一个节点下面的所有子节点内容
- struts带来的巨大烦恼…是不是系统做大了都不能使用struts?
- JBuilderX开发webService的问题
- Middlegen-Hibernate-r5已经成功连接数据库,为什么有如下错误?
- 大家开发J2EE用什么开发工具?
- JTable行选取的事件触发如何实现
- 急问,javamail包怎么用?
- j2ee环境下连接sql server2000数据库的错误信息,哪位能帮忙看一下,不甚感激!
2.
try {
//get naming context
Context context = getInitialContext(); //look up jndi name
Object ref = context.lookup("ParticipantRemote");
//look up jndi name and cast to Home interface
participantRemoteHome = (ParticipantRemoteHome) PortableRemoteObject.narrow(ref, ParticipantRemoteHome.class);
if (logging) {
long endTime = System.currentTimeMillis();
log("Succeeded initializing bean access through Home interface.");
log("Execution time: " + (endTime - startTime) + " ms.");
}
} private Context getInitialContext() throws Exception {
String url = "t3://kkk:7001";
String user = null;
String password = null;
Properties properties = null;
try {
properties = new Properties();
properties.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");
properties.put(Context.PROVIDER_URL, url);
if (user != null) {
properties.put(Context.SECURITY_PRINCIPAL, user);
properties.put(Context.SECURITY_CREDENTIALS, password == null ? "" : password);
} return new InitialContext(properties);
}
catch(Exception e) {
log("Unable to connect to WebLogic server at " + url);
log("Please make sure that the server is running.");
throw e;
}
}
一些set get方法之类 public static void main(String[] args) {
ParticipantTestClient1 client = new ParticipantTestClient1();
}3.在其它文件中这么调用
ParticipantTestClient1 client = new ParticipantTestClient1();client.xx();