乙個使用beans連線oracle的問題

2021-08-22 08:10:55 字數 511 閱讀 2599

最近做的乙個專案使用了tomcat+oracle+jsp,寫好了連線資料庫的beans後用乙個oracletest.jsp檔案測試總是連線不上,顯示一些什麼內部錯誤,最痛恨這種錯誤了。

於是又寫了個在頁面中直接連線資料庫的jsp檔案,命名為test.jsp,測試一切正常,奇怪的是這個時候再使用oracletest.jsp測試,一切都正常了。搞的我每次都要先用test.jsp連線一下才能正常用其他的使用beans的jsp檔案。

後來比較了一下兩個連線資料庫的異同,發現在test.jsp中,實用的路徑如下:class.forname("oracle.jdbc.driver.oracledriver");而在beans中,使用的路徑如下:class.forname("oracle.jdbc.driver.oracledriver");就是driver和driver的差別,乙個大小寫的差別。將beans中的改過來以後就一切正常了。

不理解的是原來beans中的路徑錯誤應該是連線不上的,為什麼用test.jsp中的正確的連線好了以後beans中的就使用正常了呢?

使用chole建立乙個連線池

using chloe using chloe.infrastructure using chloe.sqlserver using system using system.collections.generic using system.linq using system.text using s...

同步Oracle資料庫表到另乙個Oracle資料庫

同步a資料庫表test user到b資料庫a資料庫ip 192.168.1.20 test 123456b資料庫ip 192.168.1.21 test 1234561.1.建立使用者 system使用者 建立使用者create user test identified by 123456 修改使用...

使用Docker建立乙個ssh連線的容器

使用dockerfile建立乙個配置好sshd的映象 建立工作目錄 mkdir sshd centos cd sshd centos touch dockerfile run.sh 編寫run.sh指令碼和authorized keys 檔案 run.sh內容 此處會產生問題,詳情見文章最後的文字敘...