Jndi:java naming directory Interface (Java naming and Directory interface)
is a set of APIs that access naming and directory services in Java applications
Connect a resource to a service by name
Name: Specify the names of the resourced Jdai
Auth: Specify manager for Management resource (Container: Container creation and management application: Created and managed by web App)
Type: Specifies the Java class to which resource belongs
Driverclassname: The specified database driver
Username: User name to connect to the database
URL: Server address
Password: Password to connect to the database
AutoReConnect: Whether the connection is automatic when the database connection is abnormal
Autoreconnectforpools: Whether to use a reconnection policy for the database connection pool
Maxactive: The maximum number of active connections provided in the connection pool at the agreed time
Maxidle: The maximum number of database connections in which the connection pool is idle
Maxwait: The maximum number of milliseconds to wait when there is no connection in the connection pool
Specific operation:
Add under Apache-tomcat-6.0.33\conf\context.xml
<resource
Name= "Jdbc/userinfo"
Auth= "Container"
Type= "Javax.sql.DataSource"
Url= "Jdbc:oracle:thin: @localhost: 1521:orcl"
Driverclassname= "Oracle.jdbc.driver.OracleDriver"
Username= "Scott"
Password= "a"
Autoreconnect= "true"
Autoreconnectforpools= "true"
Maxactive= "100"
Maxidle= "50"
maxwait= "3000"
/>
Data Connection Pool