*
The 1,java Web project can be deployed to Tomcat, or it can be mapped to a project's actual directory by configuring Server.xml, so there is no project under Tomcat's WebApps directory, the following is the configuration in Server.xml
<ContextPath= "/myfirst"DocBase= "E:\myJava\project2\first\WebRoot"Debug= "0"reloadable= "false"> <Resourcename= "Jdbc/oracle"type= "Javax.sql.DataSource"username= "AAA"Password= "Password"Driverclassname= "Oracle.jdbc.driver.OracleDriver"Maxidle= "2"maxwait= "the"URL= "Jdbc:oracle:thin: @localhost: 1521:orcl"maxactive= "4" /></Context>
The project name is first, mapped to Myfirst, and later accessed directly through
Http://localhost:80/myfirst can
Configuration in the Tnsnames.ora of the 2,oracle
Info = ( DESCRIPTION = ( address_list = ( ADDRESS = (PROTOCOL = TCP) (HOST = localhost) (PORT = 1521 ))
(Connect_data = (service_name = ORCL) ) )
Note: 1, because here
(service_name = ORCL)
(HOST = localhost)
So in Server.xml
Url= "Jdbc:oracle:thin: @localhost: 1521:orcl"
If Plsql is connected to a database of other hosts, such as Host=192.168.1.101
, Service_name=info,
Then Url= "Jdbc:oracle:thin:@192.168.1.101:info"
The database corresponds to the service_name
*
Oracle Configuration and Server.xml configuration