系统配置:tomcat服务器5.5 sqlserver2000
所有的.jar包都有
问题:一启动tomcat服务器就报以下错误,请问如何解决org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory ([Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'market' 无效。)
struts-config.xml
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource">
<set-property
property="driverClassName"
value="com.microsoft.jdbc.sqlserver.SQLServerDriver" />
<set-property
property="url"
value="jdbc:microsoft:sqlserver://localhost:1433;databaseName=MLSystem" />
<set-property
property="username"
value="sa" />
<set-property
property="password"
value="" />
<set-property
property="maxActive"
value="0" />
<set-property
property="maxWait"
value="5000" />
<set-property
property="defaultAutoCommit"
value="false" />
<set-property
property="defaultReadOnly"
value="false" />
<set-property
property="validationQuery"
value="SELECT COUNT(*) FROM market" />
</data-source>
</data-sources>
------解决方法--------------------------------------------------------
value="SELECT COUNT(*) FROM market" />
databaseName=MLSystem
market表在MLSystem中是否存在?问题就在这里
------解决方法--------------------------------------------------------
其实在项目中validationQuery是不必需的,如果你觉得配置正常了或者发部系统时,可以不要它。