请问weblogic里配置的连接池如何访问? 对不起,没找到这段程序是在BMP里的?和客户端获取数据是不是不一样? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我把相关代码贴出来,请大家务必帮我看看!!!这是ejb中的代码 private Connection getConnection() { InitialContext initCtx = null; try { initCtx = new InitialContext(); DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/datasource"); return ds.getConnection(); }catch(Exception ex) { throw new EJBException(ex); } }我在weblogic里配置的连接池参数为: <JDBCConnectionPool CapacityIncrement="1" DriverName="sun.jdbc.odbc.JdbcOdbcDriver" InitialCapacity="1" LoginDelaySeconds="1" MaxCapacity="100" Name="DataSource" Properties="user=demo;password=demo" RefreshMinutes="1" ShrinkingEnabled="true" Targets="myserver" TestConnectionsOnRelease="false" TestConnectionsOnReserve="true" TestTableName="UnitedOffic" URL="jdbc:odbc:fp"/> <JDBCDataSource JNDIName="DemoSource" Name="United Office Demo Source" PoolName="DataSource"/>出错提示上面已经给出来了!!请大家务必帮忙! 关于JVM FULL GC的问题 gui 添加图片 是否都有必要设置conn.setAutoCommit(false) 求J2EE的常见考试或面试笔试题目 Java2类库 能不能直接用java来访问已经存在的dll文件阿 关联关系 跟 聚集关系 有没什么不一样? 请教代码出错,偶是菜鸟,感谢赐教 清华的ftp,谁知道! 新手上路,各位师哥师姐请为小弟指引一条名路! 請大家提點,我可是初學者. Applet ,Rmi访问数据库,在本机上单独执行通过,若发布到tomcat上出现错误!
这是ejb中的代码
private Connection getConnection()
{
InitialContext initCtx = null;
try {
initCtx = new InitialContext();
DataSource ds = (DataSource)initCtx.lookup("java:comp/env/jdbc/datasource");
return ds.getConnection();
}catch(Exception ex)
{
throw new EJBException(ex);
}
}我在weblogic里配置的连接池参数为:
<JDBCConnectionPool CapacityIncrement="1"
DriverName="sun.jdbc.odbc.JdbcOdbcDriver" InitialCapacity="1"
LoginDelaySeconds="1" MaxCapacity="100" Name="DataSource"
Properties="user=demo;password=demo" RefreshMinutes="1"
ShrinkingEnabled="true" Targets="myserver"
TestConnectionsOnRelease="false" TestConnectionsOnReserve="true"
TestTableName="UnitedOffic" URL="jdbc:odbc:fp"/>
<JDBCDataSource JNDIName="DemoSource"
Name="United Office Demo Source" PoolName="DataSource"/>出错提示上面已经给出来了!!请大家务必帮忙!