日期:2014-05-18  浏览次数:20667 次

struts2 中如何通过配置文件连接数据库
如题,不通过其他框架,只使用struts2.0,在配置文件连接数据库,该怎么解决啊?在线等待。。。

------解决方案--------------------
webroot\META-INF下
新建context.xml

例:
<Context>
<Resource name="jdbc/test" auth="Container"
type="javax.sql.DataSource" 
driverClassName="com.mysql.jdbc.Driver"
url="???" username="???" password="???"
maxActive="200" maxIdle="30" maxWait="-1" />
</Context>
------解决方案--------------------
貌似可以在tomcat下直接配置数据库连接池
在不使用hibernate的情况下
郑重声明:只是貌似,没有用过