下面是tomcat的context文件
<?xml version='1.0' encoding='utf-8'?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at      http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<!-- The contents of this file will be loaded for each web application -->
<Context reloadable="true">    <!-- Default set of monitored resources -->
    <WatchedResource>WEB-INF/web.xml</WatchedResource>
    <Resource name="jdbc/oracleds" auth="Container" 
     type="javax.sql.DataSource" maxActive="100" maxIdle="30" 
     maxWait="10000" username="scott" password="tiger" 
     driverClassName="oracle.jdbc.driver.OracleDriver" 
     url="jdbc:oracle:thin:@localhost:8088:1521:ora9"/>

    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
    <!--
    <Manager pathname="" />
    -->    <!-- Uncomment this to enable Comet connection tacking (provides events
         on session expiration as well as webapp lifecycle) -->
    <!--
    <Valve className="org.apache.catalina.valves.CometConnectionManagerValve" />
    --></Context>
tomcat的lib文件夹中也放上ojdbc6.jar和classes12.jar文件了但是还不行
急求高手指点,自己研究两天了还没弄出来

解决方案 »

  1.   

    1. 数据源配置:url=jdbc:oracle:thin:@localhost:8088:1521:ora9错了。。
    改为url=jdbc:oracle:thin:@localhost:1521:ora9,确定oracle的服务名是ora9。。
    2. 除了这个以外,,在程序中使用的时候还要在web.xml中配置。。
    如:
     <resource-ref>
            <description>DB connect</description>
            <res-ref-name>jdbc/oracleds</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
        </resource-ref>
      

  2.   

    我把tomcat端头改为了8088,数据库也没错,更神奇的是我两天没弄出来,也没改设置,刚才运行了一遍它自己居然通过了,不解。
      

  3.   

    你需要搞清楚的是url=jdbc:oracle:thin:@localhost:8088:1521:ora9这里的8088并不是tomcat的端口。。
      

  4.   


    那请问那里要是不写tomcat的端口那应该些什么。