mybatis mapper配置路径相关



    以上是路径配置
    抛出异常如下
    org.apache.ibatis.exceptions.PersistenceException: 

Error querying database. Cause: java.sql.SQLNonTransientConnectionException: Could not create connection to database server.

The error may exist in /mapper/Message.xml

The error may involve com.imooc.dao.Message.query

The error occurred while executing a query

Cause: java.sql.SQLNonTransientConnectionException: Could not create connection to database server.

org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:136)
com.imooc.dao.daoImpl.MessageDaoImpl.query(MessageDaoImpl.java:29)
com.imooc.service.ListService.messageQuery(ListService.java:18)
com.imooc.servlet.ListServlet.doPost(ListServlet.java:39)
com.imooc.servlet.ListServlet.doGet(ListServlet.java:26)
javax.servlet.http.HttpServlet.service(HttpServlet.java:622)
com.imooc.servlet.ListServlet.service(ListServlet.java:47)
javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)

1个回答

Message.xml,定位xml文件

MessageDaoImpl.java:29,找到上诉对应xml文件中的sql语句组,再进一步找错

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问