亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

jsp 從web.xml讀取連接數(shù)據(jù)庫的參數(shù)

 更新時(shí)間:2009年05月17日 00:43:54   作者:  
web.xml讀取連接數(shù)據(jù)庫的參數(shù),實(shí)現(xiàn)代碼。
jsp或servlet頁面代碼:
復(fù)制代碼 代碼如下:

String driver = application. getIni tParameter ("driver") ;
String url = application.getInitParameter("url");
String user = application.getInitParameter("user");
String pass = application.getInitParameter("pass");

web.xml需要讀取的內(nèi)容:
復(fù)制代碼 代碼如下:

<context-param>
<param-name>driver</param-name>
<param-value>com.mysql.jdbc.Driver</param-value>
</context-param>
<context-param>
<param-name>url</param-name>
<param-value>jdbc:mysql://localhost:3306/j2ee</param-value>
</context-param>
<context-param>
<param-name>user</param-name>
<param-value>root</param-value>
</context-param>
<context-param>
<param-name>pass</param-name>
<param-value>32l47</param-value>
</context-param>

相關(guān)文章

最新評(píng)論