WINDOWS2000 integrated Tomcat-4.1.24 and Oracle 9i connection process
Note: (Preparation of the following work)
★ Copy the Oracle / JDBC / LIB / CLASS12.jar file to this unit.
★ Set environment variables:
Variable Name: Java_Home Variable: C: /J2SDK1.4.1_02 (path according to personal situation)
Variable Name: Tomcat_Home Variable: c: /tomcat4.1 (path according to personal situation)
Step 1: Configure C: /Tomcat4.1/conf/server.xml to find in the c: /tomcat4.1/conf/server.xml file
Change it to:
Path = "" DOCBASE = "root" debug = "0">
JDBC / ORACLEDB
"auth =" container "type =" javax.sql.datasource "/>
Name = "
JDBC / ORACLEDB ">
User
ZJ
Password
ZJ
Driverclassname
Oracle.jdbc.driver.Oracledriver
Drivername
JDBC: Oracle: Thin: @ 255.255.255.255: 1521: ORADB
note:
[1]. Change JDBC / ORACLEDB to Classse12.jar
[2]. Put JDBC: Oracle: Thin: @ 255.255.255.255:1521:55:1521:55:1521
Change to:
JDBC: Oracle: Thin: @ Oracle Host IP Address: 1521: Landing Name
Description:
will
The context is removed from the comment and defines the resource item, as follows:
The Resource item (ie the DataSource object of the connection pool) has 3 properties Name, Auth, Type.
The Name item is the name definition of JNDI, and the program can find this object through JNDI, here JDBC / ORACLEDB.
The AUTH item is connected to the pool management rights attribute, and the value of the value is incorporated as container management.
Type items are subject to the type of object, here Javax.sql.DataSource, which is stated is a database connection pool.
Tyrex can not only be used as a database connection pool, but also many other features, you can open Tyrex's JAR package to see or visit www.exolab.org.
Then next
Domain content contains four parameters:
User
Password
Driverclassname
Drivername
Database
username
password
JDBC driver
Database address
Username, password is prepared for accessing the database, here is ZJ (my name).
DriverclassName, Oracle9i / jdbc / lib directory), the initial extension is ZIP, need to manually rename the classes.zip to class.jar and put it under CommON / LIB. This is available here in Oracle.jdbc.Driver.OracleDriver, which is provided by classs.jar.
as follows:
Driverclassname
Oracle.jdbc.driver.Oracledriver
For other databases, such as MySQL, its DriverClassName is generally org.gjt.mm.mysql.driver. The last parameter is DRIVERNAME, that is, the address of the database (accurate point should be called URL, 4.1.18 is called URL)
Drivername
JDBC: Oracle: Thin: @ 255.255.255.255: 1521: ORADB
Fill in the Oracle's access address here, if you are mysql, db2, sqlserver or other database, please fill in the appropriate address.
Step 2:
Copy Oracle's JDBC Copy to Tomcat Installation Directory for Classes12.jar
COMMON / LIB under Server / LIB
Like other databases, place their corresponding JDBC driver packages in CommON / lib, such as MySQL JDBC driver package mm.mysql-2.0.14.jar.
At this point, the process ends.
Author: Zhao Jing
Written on: 2004 - 08 - 05