關於tomcat 報錯 找不到oracle.jdbc.driver.OracleDriver 的解決辦法
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot create PoolableConnec
是由於
<Resource name="jdbc/mydatasource" auth="Container" type="javax.sql.DataSource" driverClassName="oracle.jdbc.driver.OracleDriver" url="jdbc:oracle:thin:@127.0.0.1:1521:oracle.domain" username="cms" password="cms" maxActive="20" maxIdle="10" maxWait="100000"/>
中的url還沒改過來的緣故
<Context crossContext="true" docBase="G:\work\svn\cnooc.20141117\webapp" path="/cnooc">
<Resource driverClassName="oracle.jdbc.driver.OracleDriver" maxActive="300" maxIdle="800" maxWait="1000" name="framework" password="sunway" type="javax.sql.DataSource" url="jdbc:oracle:thin:@192.168.183.129:1521:ora11" username="mdmcnooc"/>
</Context>
catch SQLException when trying to get connection from DataSource
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'oracle.jdbc.driver.OracleDriver'
1、 把從oracle根目錄下oracle/ora92/jdbc/lib/classes12.jar 包 拷到/SSHProject/WebRoot/WEB-INF/lib目錄下。
或者:
2、tomcat中尚未載入class12.jar包,該包可以從oracle根目錄下oracle/ora92/jdbc/lib/classes12.zip得到..然後解壓後放置於tomcat根目錄lib下
使用tomcat配置資料來源,tomcat只去自己的lib中找驅動程式。