How to operate MySQL database instances using JSP

Source: Internet
Author: User
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!

    Contact Us

    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.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.