weblogic连接池的问题,怎么解决?

ywsws 2001-09-27 03:18:14
我在jsp页面里直接连接sybase数据库没有问题:
Properties props = new Properties();
props.put("user","objuser");
props.put("password","user2000");

Driver myDriver = (Driver) Class.forName
("com.sybase.jdbc.SybDriver").newInstance();

Connection conn = myDriver.connect
("jdbc:sybase:Tds:10.92.128.71:5500/BDW_SERVER", props);

Statement stmt = conn.createStatement();

stmt.execute("select * from an_olt");
ResultSet rs = stmt.getResultSet();

while (rs.next()) {
out.print(rs.getString(1) + " - " +
rs.getString(2)+"<br>");
}

stmt.close();
conn.close();
运行没有问题,但是我建一个connection pool:
weblogic.jdbc.connectionPool.sybasePool= url=jdbc:sybase:Tds:10.92.128.71:5500, driver=com.sybase.jdbc.SybDriver, initialCapacity=1, maxCapacity=10, capacityIncrement=1, props=user=objuser;password=user2000;
然后连接这个pool:
try{
Connection conn=null;
Statement stmt=null;
Driver myDriver=(Driver) Class.forName("weblogic.jdbc.pool.Driver").newInstance();
conn=myDriver.connect("jdbc:weblogic:pool:sybasePool",null);
stmt=conn.createStatement();
}
catch(Exception e){
out.println(e);
}

weblogic报错:
java.sql.SQLException: Connection Pool sybasePool does not exist

请问是什么原因?我用的weblogic6.1是从bea的网站down下来的,还望各位大虾赐教,谢谢!
...全文
112 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
skt985 2002-01-11
  • 打赏
  • 举报
回复
41955关注! :)
gogoboys 2001-11-09
  • 打赏
  • 举报
回复
when you start your weblogic you can see the course of createing connection pool(just like "create connection pool ...") if you can not see this there must be someting wrong with your weblogic.properties(5.1sp2)
max9702 2001-11-08
  • 打赏
  • 举报
回复
你在控制台中是怎么设置的??好像不对?
greed 2001-09-28
  • 打赏
  • 举报
回复
hao

81,090

社区成员

发帖
与我相关
我的任务
社区描述
Java Web 开发
社区管理员
  • Web 开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧