写Spring的配置文件一定要注意字符串前后的空格、换行符等

<property name="driverClassName">

   <value>net.sourceforge.jtds.jdbc.Driver</value>

  </property>

<property name="url">

   <value>

            jdbc:jtds:sqlserver://192.168.20.55:1433;DatabaseName=hello

</value>

</property>

"jdbc:jtds:sqlserver://192.168.20.55:1433;DatabaseName=hello"和前后的<value>标签之间不应该有空格和换行

就因为url属性用了两个换行符,搞了两三个小时也没找出原因。因为spring居然不报url的错,而说无法load net.sourceforge.jtds.jdbc.Driver这个类!

Leave a Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.