1.在配置文件中,加入下面的配置语句
# Add a TXDataSource for the connection pool:
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool#Add an ACL for the connection pool:
weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone
2.通过初始化JNDI上下文
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("DemoPool");
con = ds.getConnection();
# Add a TXDataSource for the connection pool:
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool#Add an ACL for the connection pool:
weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone
2.通过初始化JNDI上下文
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("DemoPool");
con = ds.getConnection();
解决方案 »
- lucene源码中父类调用之类函数是笔误吗
- 一个不太复杂的管理界面,想用web浏览器作UI,应该怎么设计?
- Lucene索引超过10G,请问如何改善索引结构?提高查询效率?
- 谁能给我解释下Singleton啊...
- 新的一年我群隆重招认
- javac编译时错误:javax.ejb dose not exsit但是已经在classpath里已有E:\sun\AppServer\lib\j2ee.jar
- 概念说明
- 请问在java中,如何释放资源?急!!!
- 怎样把int转化为String
- Java1.8新特性()->{}
- 为什么版主不见了?:)
- 怎样用getComponent动态获得Component的名字
# Add a TXDataSource for the connection pool:
weblogic.jdbc.TXDataSource.weblogic.jdbc.jts.demoPool=demoPool#Add an ACL for the connection pool:
weblogic.allow.reserve.weblogic.jdbc.connectionPool.demoPool=everyone
2.通过初始化JNDI上下文获得连接
InitialContext ic = new InitialContext();
DataSource ds = (DataSource)ic.lookup("DemoPool");
con = ds.getConnection();