gpt4 book ai didi

mysql - spring mybatis与mysql选择数据时出现 "Cannot create PoolableConnectionFactory (FUNCTION java_blog.getdate does not exist) "

转载 作者:行者123 更新时间:2023-11-29 21:41:17 28 4
gpt4 key购买 nike

代码: 我的 java 域:用户

public class User {

private long id;
private String loginName;
private String passWord;
private String name;
private String email;
private String url;
private Timestamp registerDate;
private int status;
private Timestamp updateTime;

并且有 setter 和 getter。

我的 mysql 数据库表用户喜欢:

    CREATE TABLE `jb_users` (
`ID` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
`login_name` varchar(60) NOT NULL DEFAULT '',
`password` varchar(64) NOT NULL DEFAULT '',
`name` varchar(50) NOT NULL DEFAULT '',
`email` varchar(100) NOT NULL DEFAULT '',
`url` varchar(100) NOT NULL DEFAULT '',
`register_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`status` int(11) NOT NULL DEFAULT '0',
`update_date` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`ID`),
KEY `user_login_key` (`login_name`),
KEY `user_nicename` (`name`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8

当我从java_blog.user中选择数据时,发生错误。

错误信息:

org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not

get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FUNCTION java_blog.getdate does not exist)

The error may exist in com/blog/persistence/dao/user/IUserDAO.java (best guess)

The error may involve com.blog.persistence.dao.user.IUserDAO.getUserById

The error occurred while executing a query

Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is

org.apache.commons.dbcp.SQLNestedException: Cannot create PoolableConnectionFactory (FUNCTION java_blog.getdate does not exist) org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:981) org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:860) javax.servlet.http.HttpServlet.service(HttpServlet.java:622) org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:845) javax.servlet.http.HttpServlet.service(HttpServlet.java:729) org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52) org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:121) org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

最佳答案

请显示您的映射器 xml 代码。我认为你应该关注嵌套异常:FUNCTION java_blog.getdate does not exit

关于mysql - spring mybatis与mysql选择数据时出现 "Cannot create PoolableConnectionFactory (FUNCTION java_blog.getdate does not exist) ",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34469809/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com