Topic: 无法使用UserTransaction |
Print this page |
1.无法使用UserTransaction | Copy to clipboard |
Posted by: denggary Posted on: 2006-05-23 10:15 import javax.transaction.*;但无法使用UserTransaction类 编译时总提示cannot resolve symbol symbol:class UserTransaction import javax.transaction.*; 代码片断 Context ctx=null; Hashtable env=new Hashtable(); UserTransaction tx=null; env.put(Context.INITIAL_CONTEXT_FACTORY,"weblogic.jndi.WLInitialContextFactory"); env.put(Context.PROVIDER_URL,"t3://192.168.0.104:7001"); env.put(Context.SECURITY_PRINCIPAL,"gary"); env.put(Context.SECURITY_CREDENTIALS,"***"); ctx= new InitialContext(env); tx=(UserTransaction)ctx.lookup("java:comp/UserTransaction"); 是JNDI的关系还是何处编译的问题?请哪位大侠赐教两句,感谢感谢 |
2.Re:无法使用UserTransaction [Re: denggary] | Copy to clipboard |
Posted by: hayash Posted on: 2006-06-23 23:11 UserTransaction 是个接口。 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |