Configuring data connection pool

xiaoxiao2021-03-06  106

1. Declare the engineering level DB POOL ??

Tag

Declare an engineering catalog

???????

????????? cachingAllowed = "True"

????????? charsetMapperclass = "org.apache.catalina.util.charsetmapper"

????????? cookies = "true" crossContext = "false" debug = "0"

????????? displayName = "testpool" docbase = "d: / tomcat_4_1_30 / webApps / xxx"

????????? Mapperclass = "org.apache.catalina.core.standardContextMapper"

????????? path = "/ xxx" privileged = "false" reloadable = "false"

????????? Swallowoutput = "false" usenaming = "true"

????????? wrapperclass = "org.apache.catalina.core.standardwrapper">

???????

???????

??

Insert the following configuration section inserted within the label:

??????????

??????????

???????????? scope = "shareable" type = "org.apache.catalina.userdatabase" />

??????????

???????????

?????????????

URL

??????????

JDBC: mysql: // localhost: 3306 / test? Useunicode = TRUE

& characterencoding = GBK

??????????????????????

?????????????

Password

?????????????

PWD

???????????

???????????

?????????????

Maxactive

?????????????

10

???????????

???????????

?????????????

Maxwait

?????????????

5000

???????????

???????????

?????????????

Driverclassname

?????????????

Org.gjt.mm.mysql.driver

???????????

???????????

?????????????

Username

?????????????

User

???????????

???????????

?????????????

MaxIdle

?????????????

5

???????????

????????? ??????????????

???????????

?????????????

Factory

?????????????

Org.apache.catalina.users.MemoryUserDatabaseFactory

???????????

???????????

?????????????

Pathname

?????????????

Conf / tomcat-users.xml

???????????

??????????

2. Declare the first method of the global DB POOL ??: Use the Tomcat Administration Tool Tool graphic configuration data source; ?? Second method: ???? Add global db pool jndi declaration under the label

?????

???? Continue to increase the configuration festival as follows

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

?????

???????

Maxwait

???????

5000

?????

?????

???????

Maxactive

???????

4

?????

?????

???????

Password

???????

PWD

?????

?????

???????

URL

???????

JDBC: mysql: // localhost: 3306 / dbname? Autoreconnect = true

?????

?????

???????

Driverclassname

???????

Org.gjt.mm.mysql.driver

?????

?????

???????

MaxIdle

???????

2

?????

?????

???????

Username

???????

User

?????

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

?? Quote the global db pool in your project: ??

Insert within the label is referenced

???????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????

3. Necessity for adding settings under WEB.XML under construction

Data display, need

Insert the following configuration section:

MySQL Test APP

DB Connection

MySQLPool

Javax.sql.datasource

Container

Conclusion: It seems that it is useless, huh, huh, the engineering level is definitely no, the overall seeming to be useless.

4. Some precautions when configuring?? If you change the Tomcat settings, find that you can't start, or an XML interpreter error, check your XML pair; ?? In addition, please topically XML encoding is set to GB2312. If you want to change, try to use the encoding of UTF, as soon as possible, try to set the space between all the labels in the XML file, and these stuff sometimes leads to an error. This is especially the case under the liunx / unix platform; ?? ?? Finally, I wish you all good luck, free open source Dongdong is the information incomplete, including APACHD.

转载请注明原文地址:https://www.9cbs.com/read-123525.html

New Post(0)