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();

解决方案 »

  1.   

    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();