Tomcat configuration connects to the c3p0 connection pool,
1. Configure the JNDI resource for Tomcat
JNDI (Java Naming and Directory Interface), Java Naming and Directory Interface.
The role of JNDI is to configure resources on the server and then obtain the configured resources in a unified manner.
The resource we want to configure here is of course the connecti
request processing threads. Any requests received when the ' queue is full are refused. The default value is 10.
Disableuploadtimeout-whether to use timeout mechanism when uploading
enablelookups-Checks whether the domain name is reversed, and evaluates to: TRUE or false. To improve processing power, set to False
buffersize-defines the size (in bytes) of the ' buffer to be ' provided for input streams created from this connector. By default, buffers of 2048 bytes are provided.
maxsparethreads–
With the latest in a couple of drums, it's been a whole day. Tomcat 5.5 configuration MySQL database connection pool, online experience can not be fully used in the new environment, I write the whole process to facilitate the configuration.
1 Environment Description
JDK 1.5
Tomcat 5.5.4
MySQL 4.0.20
MySQL JDBC 3.0.15
Commons DBCP 1.2.1
2 Preparation work
JDK,
1. Drive the database
Program In the common/lib directory of Tomcat;
2. Set the data source in server. xml. Take MySQL database as an example, as follows:Add the following content to the Name = "JDBC/dbpool"Type = "javax. SQL. datasource"Password = "root"Driverclassname = "com. MySQL. JDBC. Driver"Maxidle = "2"Maxwait = "5000"Username = "root"Url = "JDBC: mysql: // 127.0.0.1: 3306/test"Maxactive = "4"/>Attribute description: name, data source name
The database is used for Web site development. A simple database connection will reconnect to the database each time, resulting in slower access, which the connection pool is designed to address, and Tomcat himself provides. OK, let's see how we can use the connection pooling mechanism provided by Tomcat to make a database connection. (add: The
Configure the MySQL database connection pool in Tomcat [Author: alias post: It lab hits: 11149 updated:]
1. Add the configuration information in $ catalina_home/CONF/server. XML to declare the specific information of the connection pool. Add the following content:
2. Add the following information before $ catalina_home/CONF/Web. xml
1. add the configuration information in $ CATALINA_HOMEconfserver.xml and declare the specific information of the connection pool. the added content is as follows :! -- Declare the connection pool -- ResourcenamejdbcmysqlauthContainertypejavax. SQL. DataSource Tomcat
1. add the configuration information in $ CATALINA_HOME/conf/server. xml to declare the specifi
In general, the database connection pool is configured in Tomcat, and we constantly establish database connections. This is the case if the database connection is not closed.Common: cannot get a connection, pool exhaustedcannot get a connection, poolExhausted. In fact, this is because the connections in the connection pool
TOMCAT7 enhanced the Database connection pooling feature with the following connection pool configuration:validationquery= "Select 1 from Dual" url= ""/>Modify the URL property values according to the use of MySQL and Oracle.Testonborrow is set to true. Whenever data is taken from the connection pool, the connection is judged to be valid. You can prevent the back-end database from being disconnected, and th
1 Tomcat Configuration Jndi ResourceJNDI (Java naming and directory Interface), Java naming and directory interfaces. The purpose of Jndi is to configure resources on the server and then to obtain the configured resources in a unified manner.The resources we are configuring here are, of course, connection pooling, so that the connection pool object can be obtained in a unified manner in the project.Configur
Tags: des io ar os using SP Java file dataRecently maintained a project has a problem, the final analysis is stuck in the database connection pool, and then did some learning.First write my own method, and then the other online no success of the method.1, first of all, of course, the MySQL jar package is placed in the Lib directory, toncat or their own projects under the Lib can.2, in the Tomcat conf direct
1.JNDI (Java naming and directory Interface,java naming and directory interface)is a set of APIs that access the naming and directory services in a Java application. The naming service links names to objects so that we can access them by name. A directory service is a naming service in which objects are not only named but also attributes. It can be understood as a container in which any content can be stored, a string name is given to the content in the container, the name is named in the direct
Author Tag: Tomcat MySQL
Tomcat 5.0.28 MySQL 5 connection pool establishment reference http://tomcat.apache.org/tomcat-5.0-doc/jndi-datasource-examples-howto.html
1. Download the MySQL JDBC driverHttp://mysql.mirror.vmmatrix.net/Downloads/Connector-J/mysql-connector-java-3.1.13.tar.gzDecompress the package and copy th
mysql| Data | database | database connection
After a long day of practice and groping, and finally under Tomcat successfully configured MySQL database connection pool. Summarized as follows:
1. Add the configuration information to the $catalina_home/conf/server.xml, declare the connection pool specific information, add the following content:
1. First configure the Tomcat connection pool server.xml inside (not to mention many examples of Google above)
Note: Copy Oracle's JDBC connection to the Tomcat package. (Path:/common/lib/)
2. Configure the. XML configuration file for spring my name is application-context.xml (personal custom name)
Java:comp/env/jdbc/name This is the connection
intRecheck =ctl.get (); + if(! isrunning (Recheck) Remove (command)) - reject (command); the Else if(Workercountof (recheck) = = 0) *Addworker (NULL,false); $ }Panax Notoginseng Else if(!addworker (Command,false)) - reject (command); the}The Execute method in ThreadexecutorIt is clear from the comments of the Execute method that the traditional thread joins the thread pool execution process in 3 ste
Tags: io os using java ar for file data spA: First configure the data source in the Contenx tag in the Conf/context.xml file under Tomcat:Auth= "Container" type= "Javax.sql.DataSource"Maxactive= "maxidle=" maxwait= "10000"Username= "sa" password= "sa"Driverclassname= "Com.microsoft.sqlserver.jdbc.SQLServerDriver"Url= "Jdbc:sqlserver://127.0.0.1:1433;databasename=testdb"/>Name: Specifies the Jndi name of the resourceAuth: Specifies the manager that manages resource, which has two optional values:
Label:It must have been those who stepped on the pit before they were eager to fill the pit.Tomcat database connection pool configuration, originally is a very simple thing, there are a lot of articles on the Internet, but mostly only text description, no Diagram Wizard, for beginners, the information is too large, it is easy to find out where is where, so after bypassing countless bends on the deep pit, This small white decided for the vast number of
connection: logabandoned = "true"
Configure server. xmlThe server. xml file is in the conf subdirectory of the tomcat installation directory. Add the following code before Configure web. xmlYou need to configure web. XML for the current application. The main function is to declare the data source. The Code is as follows: Use the connection pool to access the databaseThe process of accessing a database usin
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.