mysql和java和jsp的联系,Tomcat和MySQL的一个Server.xml-JSP教程,Java与XML

$catalina_home/conf/server.xml

debug="5" reloadable="true" crosscontext="true">

prefix="localhost_dbtest_log." suffix=".txt"

timestamp="true"/>

auth="container"

type="javax.sql.datasource"/>

factory

org.apache.commons.dbcp.basicdatasourcefactory

configure your mysqld max_connections large enough to handle

all of your db connections. set to 0 for no limit.

–>

maxactive

100

set to -1 for no limit. see also the dbcp documentation on this

and the minevictableidletimemillis configuration parameter.

–>

maxidle

30

in ms, in this example 10 seconds. an exception is thrown if

this timeout is exceeded. set to -1 to wait indefinitely.

–>

maxwait

10000

username

javauser

password

javadude

if you want to use this driver – we recommend using connector/j though

driverclassname

org.gjt.mm.mysql.driver

–>

driverclassname

com.mysql.jdbc.driver

the autoreconnect=true argument to the url makes sure that the

mm.mysql jdbc driver will automatically reconnect if mysqld closed the

connection. mysqld by default closes idle connections after 8 hours.

–>

url

jdbc:mysql://localhost:3306/javatest?autoreconnect=true

该应用的配置web-inf/web.xml

xmlns:xsi="http://www.w3.org/2001/xmlschema-instance"

xsi:schemalocation="http://java.sun.com/xml/ns/j2ee

http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"

version="2.4">

mysql test app

db connection

jdbc/testdb

javax.sql.datasource

container

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值