Cannot create JDBC driver of class '' for connect URL 'null'錯誤訊息的方法,
Google到的資訊實在太多做法了,把試成功的經驗記錄一下。
step1:在專案內的WEB-INF/加入context.xml檔
<xml version="1.0" encoding="UTF-8"?>
<Context >
<Resource
name="jdbc/資料表連接名稱"
auth="Container"
type="javax.sql.DataSource"
maxActive="100"
maxIdle="30"
maxWait="10000"
username="root"
password="密碼"
driverClassName="com.mysql.jdbc.Driver"
autoReconnect="true"
removeAbandoned="true"
removeAbandonedTimeout="300"
logAbandoned="false"
url="jdbc:mysql://遠端IP:3306/資料庫名稱"/>
Context>
Tip:DBCP已經設全域設定了,所以這個不用加
非常重要!!記得要重新開Tomcat!!
沒有留言:
張貼留言
留個話吧:)