0

code: my java domain: User

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;

and has setter and getter.

my mysql db table user like:

    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

when I select data from java_blog.user, and error happen.

error message:

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)

Atlas
  • 31
  • 6

1 Answers1

0

show your mapper xml code please. I think you should focus on the nested exception :FUNCTION java_blog.getdate does not exist

Persia
  • 855
  • 5
  • 8