spring整合ibaits出错,实在找不到问题所在

IOException parsing XML document from class path resource [sqlMapConfig.xml]; nested exception is java.net.ConnectException: Connection timed out: connect

我的sqlMapConfig.xml文件如下:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMapConfig PUBLIC "-//iBATIS.com//DTD SQL Map Config 2.0//EN" "http://www.ibatis.com/dtd/sql-map-config-2.dtd">
<sqlMapConfig>
<settings cacheModelsEnabled="true" enhancementEnabled="true"
    lazyLoadingEnabled="true" maxRequests="32" maxSessions="10"
    maxTransactions="5" useStatementNamespaces="true" />
<sqlMap resource="com/fruit/config/sqlmap/merchant.xml"/>
</sqlMapConfig>

不知道是什么问题 补充一下,我连的数据库是mysql,防火墙都关了,如果直接用ClassPathXmlApplicationContext是可以访问数据库的。

阅读 5.1k
1 个回答

sqlMapConfig.xml文件是不是写的有问题

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题