JNDI ---- Data Connection Pool

JNDI: Find and provide universal access to a variety of naming and directory services, unified interface

      Common configuration properties:

         name: represents the name you want to find later. This name can be found DataSource, this name any replacement, but the program is ultimately to find this name.

        

        auth: authorization and managed by the container, referring to the user name and password can enter into force on the container

 

 

          type: type this name represents, now javax.sql.DataSource

 

 

          maxActive: indicates the maximum number of connections to a database on this server can open

 

 

          maxIdle: represents the minimum number of connections in a database maintained on this server

 

 

          maxWait: maximum waiting time. 10000 milliseconds

 

 

          username: username database connection

 

 

          password: password database connection

 

 

          Driver database connections: driverClassName

 

 

          url: address database connection

 

  

Configure MySQL database data source JNDI

      <Resource

                name="jdbc/mysql"

                auth="Container"

                type="javax.sql.DataSource"

                maxActive="100"

                maxIdle="30"

                maxWait="10000"

                username="root"

                password="root"

                driverClassName="com.mysql.jdbc.Driver"

      url="jdbc:mysql://192.168.1.144:3306/leadtest?useUnicode=true&characterEncoding=utf-8"/>

 

Guess you like

Origin www.cnblogs.com/lowerma/p/11330514.html