在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
jsp或servlet页面代码: 复制代码 代码如下: String driver = application. getIni tParameter ("driver") ; String url = application.getInitParameter("url"); String user = application.getInitParameter("user"); String pass = application.getInitParameter("pass"); web.xml需要读取的内容: 复制代码 代码如下: <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> |
请发表评论