无
无雨
Unregistered / Unconfirmed
GUEST, unregistred user!
各位能告诉我,struts连接数据库的怎样配置
当我在struts-config.xml内加
<data-sources>
<data-source>
<set-property value="false" property="autoCommit"/>
<set-property value="org.gjt.mm.mysql.Driver" property="driverClass"/>
<set-property value="4" property="maxCount"/>
<set-property value="###" property="password"/>
<set-property value="jdbc:mysql://localhost:3306/mystruts" property="url"/>
<set-property value="###" property="user"/>
</data-source>
</data-sources>
就会出错了:
javax.servlet.ServletException: Servlet.init() for servlet action threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:963)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(
当我在struts-config.xml内加
<data-sources>
<data-source>
<set-property value="false" property="autoCommit"/>
<set-property value="org.gjt.mm.mysql.Driver" property="driverClass"/>
<set-property value="4" property="maxCount"/>
<set-property value="###" property="password"/>
<set-property value="jdbc:mysql://localhost:3306/mystruts" property="url"/>
<set-property value="###" property="user"/>
</data-source>
</data-sources>
就会出错了:
javax.servlet.ServletException: Servlet.init() for servlet action threw exception
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:963)
at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:668)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:210)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2415)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
at org.apache.catalina.valves.ErrorDispatcherValve.invoke(