当前位置:编程学习 > JAVA >>

SSH的程序连接数据库连接不上去!用的tomcat..

连接的是SQL2005数据库,死活连接不上去,也不报错,就是读不到数据,求教各位大侠帮忙看看,或者谁会调试SSH的,留下QQ帮帮小弟,谢谢啦。

spring.xml里的数据池部分:<!-- 注入DataSource数据源 -->
<bean id="DataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver">
</property>
<property name="url"
value="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=NsStorage">
</property>
<property name="username" value="sa"></property>
<property name="password" value="123"></property>

</bean>
web.xml里的内容:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee   http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/Spring.xml, /WEB-INF/Carmack_Spring.xml,
/WEB-INF/Mars_Spring.xml, /WEB-INF/Moster_Spring.xml,
/WEB-INF/Opt_Spring.xml, /WEB-INF/Yasak_Spring.xml
</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>SpringLog4jConfigServlet</servlet-name>
<servlet-class>
org.springframework.web.util.Log4jConfigServlet
</servlet-class>
</servlet>
<servlet>
<servlet-name>web</servlet-name>
<servlet-class>
org.springframework.web.servlet.DispatcherServlet
</servlet-class>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/Carmack_struts-config.xml,
/WEB-INF/Mars_struts-config.xml,
/WEB-INF/Moster_struts-config.xml,
/WEB-INF/Opt_struts-config.xml,
/WEB-INF/Yasak_struts-config.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
 <filter>
    <description>This is the description of my J2EE component</description>
    <display-name>This is the display name of my J2EE component</display-name>
    <filter-name>FilterChina</filter-name>
    <filter-class>com.filter.FilterChina</filter-class>
  </filter>
<servlet>
<servlet-name>DisplayChart</servlet-name>
<servlet-class>
org.jfree.chart.servlet.DisplayChart
</servlet-class>
</servlet>


<servlet-mapping>
<servlet-name>DisplayChart</servlet-name>
<url-pattern>/servlet/DisplayChart</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
  <filter-mapping>
    <filter-name>FilterChina</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
<welcome-file-list>
<welcome-file>Opt/Login.html</welcome-file>
</welcome-file-list>
</web-app>
连接的是SQL2005数据库,死活连接不上去,也不报错,就是读不到数据,求教各位大侠帮忙看看,或者谁会调试SSH的,留下QQ帮帮小弟,谢谢啦。

--------------------编程问答-------------------- 我给个SSH的配置,你自己看下应该就知道了!需要加我QQ755874434
补充:Java ,  Web 开发
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,