Java 无法使用Spring Boot和JDBC获取计数或将记录保存到MySQL数据库

Java 无法使用Spring Boot和JDBC获取计数或将记录保存到MySQL数据库,java,spring-boot,spring-jdbc,Java,Spring Boot,Spring Jdbc,我试图从MySQL中名为students_accounts的预创建表中获取记录计数,该表位于Spring Boot项目中的数据库fcms中,但是总会引发NullPointerException: 2019-12-28 00:17:51.353信息15456---[nio-8080-exec-2]c.vaadin.flow.spring.SpringInstantiator:实现“I18NProvider”的bean数为0。无法将SpringBean用于I18N,返回默认行为 用户名:170104

我试图从MySQL中名为students_accounts的预创建表中获取记录计数,该表位于Spring Boot项目中的数据库fcms中,但是总会引发NullPointerException:

2019-12-28 00:17:51.353信息15456---[nio-8080-exec-2]c.vaadin.flow.spring.SpringInstantiator:实现“I18NProvider”的bean数为0。无法将SpringBean用于I18N,返回默认行为
用户名:1701040191,密码:hdsfzg43y6
1701040191
hdsfzg43y6
用户名:1701040191,密码:hdsfzg43y6
2019-12-28 00:17:56.936错误15456---[nio-8080-exec-8]o.a.c.c.c.[/].[dispatcherServlet]:路径为[]的上下文中Servlet[dispatcherServlet]的Servlet.service()引发异常[请求处理失败;嵌套异常为java.lang.NullPointerException],其根本原因是
java.lang.NullPointerException:null
在org.duaf1xd.model.Account.getCount(Account.java:49)~[classes/:na]
在org.duaf1xd.controller.AccountController.submitCreateForm(AccountController.java:32)~[classes/:na]
在sun.reflect.NativeMethodAccessorImpl.invoke0(本机方法)~[na:1.8.0_181]
在sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)~[na:1.8.0\u 181]
在sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)~[na:1.8.0181]
在java.lang.reflect.Method.invoke(Method.java:498)~[na:1.8.0_181]
在org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.ServletinInvocableHandlerMethod.invokeAndHandle(ServletinInvocableHandlerMethod.java:106)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:888)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在javax.servlet.http.HttpServlet.service(HttpServlet.java:660)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)~[spring-webmvc-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在javax.servlet.http.HttpServlet.service(HttpServlet.java:741)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)~[tomcat-embed-websocket-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)~[spring-web-5.2.2.RELEASE.jar:5.2.2.RELEASE]
在org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)~[tomcat-embed-core-9.0.29.jar:9.0.29]
在org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)~[tomcat-embed-core-9.0.29.jar:9.0.29]
位于org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)