Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » Database/JDBC/SQL/JDO/Hibernate  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? [Re:xlwh123]
im_is





发贴: 2
积分: 0
于 2005-05-15 14:23 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
问一下,Tomcat5.5中的数据源和连接池配置的XML格式是不是和Tomcat5.0以前的版本不一样了,看很多人介绍数据原配置是这样的:
<Context path="/test" docBase="test" debug="0" reloadable="true" crossContext="true">
<Resource name="jdbc/connectDB" auth="Container" type="javax.sql.DataSource"/>
<ResourceParams name="jdbc/connectDB">
<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>
<parameter>
<name>factory</name>
<!-DBCP Basic Datasource Factory -->
<value>org.apache.commons.dbcp.BasicDataSourceFactory</value>
</parameter>
<parameter>
<name>username</name>
<!-- Database User Name -->
<value>root</value>
</parameter>
<parameter>
<name>password</name>
<!-- User Password -->
<value></value>
</parameter>
<parameter>
<name>driverClassName</name>
<!-- Database Driver Class Name -->
<value>com.mysql.jdbc.Driver</value>
</parameter>
<parameter>
<name>url</name>
<!-- Database Address -->
<value>jdbc:mysql://localhost/test</value>
</parameter>
</ResourceParams>
</Context>

今天按这个方法在Tomcat5.5中配置的一上午老是不行。后来看了Tomcat5.5的文档,按如下配置:
<Context path="/test" docBase="test"
debug="0" reloadable="true" crossContext="true">

<Resource name="jdbc/connectionDB" auth="Container" type="javax.sql.DataSource"
maxActive="100" maxIdle="30" maxWait="10000"
username="root" password="root" driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://localhost:3306/test?autoReconnect=true"/>

</Context>

是不是Tomcat5.5一定要用后面这种配置了?




如何用JTable设置表头多行

话题树型展开
人气 标题 作者 字数 发贴时间
9568 Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? xlwh123 689 2005-04-03 08:47
8150 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? 九佰 33 2005-04-08 09:01
8322 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? im_is 2520 2005-05-15 14:23
8188 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? why 670 2005-04-06 23:32
8376 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? InnocentBoy 20 2005-04-07 17:39
8163 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? 九佰 16 2005-04-07 18:12
8073 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? why 76 2005-04-07 20:26
8271 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? xlwh123 422 2005-04-10 22:39
8158 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? why 233 2005-04-11 07:20
8252 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? xlwh123 181 2005-04-11 10:53
8010 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? why 34 2005-04-11 19:47
8232 Re:Win2000+Tomcat 5.5+SQL2000+j2sdk1.4.2_05 数据库连接问题??? xlwh123 58 2005-05-01 02:04

flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923