java連接mysql使用 ssh

tomcat context部分

<Resource name="jdbc/數據庫名稱"
type="javax.sql.DataSource"
username="root"
password="root"
driverClassName="com.mysql.jdbc.Driver"
maxIdle="30"
url="jdbc:mysql://127.0.0.1:3306/數據庫名稱"
maxActive="500"/>


web.xml部分

<resource-ref>
<res-ref-name>jdbc/數據庫名稱</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
<res-sharing-scope>Shareable</res-sharing-scope>
</resource-ref>


其他部分一樣

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章