关于Struts-config.xml中配置数据源<data-source>中的type?? 10
请各位高手关照一下了!谢谢了!急的很!Struts-config.xml配置情况:<struts-config><data-sources><data-sourcetyp...
请各位高手关照一下了!谢谢了!急的很!
Struts-config.xml配置情况:
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="minCount" value="1" />
<set-property property="password" value="123" />
<set-property property="maxCount" value="10" />
<set-property property="userName" value="db2admin" />
<set-property property="driverClassName" value="COM.ibm.db2..jdbc.app.DB2Driver" />
<set-property property="description" value="My Struts's datebase from DB2" />
<set-property property="url" value="jdbc:db2:wl" />
<set-property property="autoCommit" value="true" />
<set-property property="readOnly" value="false" />
</data-source>
</data-sources>
Action中调用情况:
javax.sql.DataSource datasource;
java.sql.Connection myConnection = null;
java.sql.Statement stmt=null;
try{
datasource=getDataSource(request);
myConnection=datasource.getConnection();
stmt=myConnection.createStatement();
}catch(SQLException sqle){
getServlet().log("Connection.process",sqle);
}
出错地方:
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
javax.servlet.UnavailableException: org/apache/commons/pool/impl/GenericObjectPool
2008-7-11 11:50:04 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet action is currently unavailable 展开
Struts-config.xml配置情况:
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property property="minCount" value="1" />
<set-property property="password" value="123" />
<set-property property="maxCount" value="10" />
<set-property property="userName" value="db2admin" />
<set-property property="driverClassName" value="COM.ibm.db2..jdbc.app.DB2Driver" />
<set-property property="description" value="My Struts's datebase from DB2" />
<set-property property="url" value="jdbc:db2:wl" />
<set-property property="autoCommit" value="true" />
<set-property property="readOnly" value="false" />
</data-source>
</data-sources>
Action中调用情况:
javax.sql.DataSource datasource;
java.sql.Connection myConnection = null;
java.sql.Statement stmt=null;
try{
datasource=getDataSource(request);
myConnection=datasource.getConnection();
stmt=myConnection.createStatement();
}catch(SQLException sqle){
getServlet().log("Connection.process",sqle);
}
出错地方:
java.lang.NoClassDefFoundError: org/apache/commons/pool/impl/GenericObjectPool
javax.servlet.UnavailableException: org/apache/commons/pool/impl/GenericObjectPool
2008-7-11 11:50:04 org.apache.catalina.core.StandardWrapperValve invoke
信息: Servlet action is currently unavailable 展开
2个回答
展开全部
请导入commons-pool.jar包和commons-dbcp.jar,在struts官方包下有.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
网易云信
2023-12-06 广告
2023-12-06 广告
UIkit是一套轻量级、模块化且易于使用的开源UI组件库,由YOOtheme团队开发。它提供了丰富的界面元素,包括按钮、表单、表格、对话框、滑块、下拉菜单、选项卡等等,适用于各种类型的网站和应用程序。UIkit还支持响应式设计,可以根据不同...
点击进入详情页
本回答由网易云信提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询