JSP-based MySQL database instance description 1: before getting started, let's talk about why we should write this article. I personally think that as an O & M engineer, we should be familiar with the knowledge network, it is not limited to the mastery of some knowledge,
JSP-based MySQL database instance description 1: before getting started, let's talk about why we should write this article. I personally think that as an O & M engineer, we should be familiar with the knowledge network, it is not limited to the mastery of some knowledge,
How to operate MySQL database instances using JSP
I. Overview
Before getting started, let's talk about why we should write this article. I personally think that as an O & M engineer, we should be familiar with the knowledge network and the Hong Kong space, not just by the knowledge of some points, for example, the linux system, the construction of web servers, databases, and so on should be familiar with the networks composed of these points. Specifically, how do the points affect each other, how to operate on each other between points. For example, when a problem occurs at a point, we can analyze the system to find the root cause of the problem. So how does the JSP program (or PHP, ASP, etc.) on the web front end establish a line with the background database through the Intermediate Program (here we will temporarily set up JSP, tomcat, mysql is called a so-called line), how to communicate, how to affect each other, there is too much content involved here, limited to personal level hate, just introduce how JSP through tomcat, The United States space, connect to the mysql database in the background.
2. Topology
Lab environment: Centos5.8 (kernel 2.6.18) + tomcat5.5 + mysql5.0
Iii. JSP connection to MySQL
Mysql database server setup --> For details, see
Note: Server construction is not the focus of this Article
Here we will first introduce the front-end JSP page and Tomcat connection knowledge point, the Hong Kong virtual host, here to talk about my understanding, first JSP program and tomcat communication through the connection pool provided by tomcat, tomcat can set the maximum number of connections in the connection pool to provide JSP program connections. connections in the connection pool can be dynamically released and recycled. However, the number of connections provided in the connection pool is smaller than the number of Mysql connection pools.
Tomcat configuration connection pool
Type = "javax. SQL. DataSource"
Tomcat5.5 parameter explanation:
Create a WEB-INF/web. xml in the directory of the web application and add the following content
User who connects to the database through JSP
JSP test page
Iv. Test
This article is from the "haangangular" blog. For more information, contact the author!