請教。在ejb中用DataSource連線資料庫,報錯!

maple_0702發表於2004-10-22
我在ejb中用直連方式沒有問題。

用DataSource就不行,我的code:
public Connection getConnection(){
Connection con = null;
DataSource ds = null;
try{
InitialContext ctx = new InitialContext();
System.out.println("ccccccccccccccccc");
ds = (DataSource)ctx.lookup("java:comp/env/estore");
System.out.println("dddddddddddddddd");
con = ds.getConnection();
System.out.println("eeeeeeeeeeeeeeeeeeeee");
}
catch(Exception e){
e.printStackTrace();
}

return con;
}
執行不到System.out.println("eeeeeeeeeeeeeeeeeeeee");

丟擲的異常:
java.lang.NoClassDefFoundError: weblogic/jdbc/wrapper/PoolConnection

java.sql.SQLException: Cannot obtain connection: driverURL = jdbc:weblogic:pool:estoreConn
ectionPool, props = {enableTwoPhaseCommit=false, jdbcTxDataSource=true, connectionPoolID=e
storeConnectionPool, dataSourceName=estoreDataSource}.

相關文章