| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 504 人关注过本帖
标题:数据库连接池配置问题
只看楼主 加入收藏
wangliwei
Rank: 1
等 级:新手上路
帖 子:19
专家分:0
注 册:2007-7-14
收藏
 问题点数:0 回复次数:1 
数据库连接池配置问题

<Context path="" docBase="ROOT" debug="0" reloadable="true" crossContext="true">
<Resource name="jdbc/connectDB" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/connectDB">
<parameter>
<name>factory</name>
<!--DBCP Basic Datasource Factory -->
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>driverClassName</name>
<!-- Database Driver Class Name -->
<value>net.sourceforge.jtds.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<!-- Database Address -->
<value>jdbc:jtds:sqlserver://127.0.0.1:1433/JapanProject</value>
</parameter>
<parameter>
<name>username</name>
<!-- Database User Name -->
<value>sa</value>
</parameter>
<parameter>
<name>password</name>
<!-- User Password -->
<value>123</value>
</parameter>
<parameter>
<name>maxActive</name>
<!-- Maximum number of DB connections in pool.Set to 0 for no limit. -->
<value>100</value>
</parameter>
<parameter>
<name>maxIdle</name>
<!-- Maximum number of idle DB connections to retain in pool.Set to 0 for no limit. -->
<value>30</value>
</parameter>
<parameter>
<name>maxWait</name>
<!-- Maximum time to wait for a DB connection to become available in ms.An exception is thrown if this timeout is exceeded.Set to -1 to wait indefinitely. -->
<value>10000</value>
</parameter>
<parameter>
<name>removeAbandoned</name>
<!-- Abandoned DB connections are removed and recycled -->
<value>true</value>
</parameter>
<parameter>
<name>removeAbandonedTimeout</name>
<!-- Use the removeAbandonedTimeout parameter to set the number of seconds a DB connection has been idle before it is considered abandoned. -->
<value>60</value>
</parameter>
<parameter>
<name>logAbandoned</name>
<!-- Log a stack trace of the code which abandoned -->
<value>false</value>
</parameter>


</ResourceParams>
</Context>
报错:
org.apache.jasper.JasperException: Cannot create JDBC driver of class '' for connect URL 'null'
org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:510)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:375)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

这是为什么?

搜索更多相关主题的帖子: 数据库连接池 
2007-08-03 16:03
小轩子
Rank: 1
等 级:新手上路
威 望:1
帖 子:42
专家分:0
注 册:2006-12-13
收藏
得分:0 
第一句<Context path="" docBase="ROOT" debug="0" reloadable="true" crossContext="true">
应该改为
<Context path="/test" docBase="ROOT" debug="0" reloadable="true" crossContext="true">
path路径你不能填空。最好也不要出现中文字符。
2007-08-06 17:54
快速回复:数据库连接池配置问题
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.016228 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved