SSM when JDBC Error cannot create poolableconnectionfactory (the server time zone value "Й׼ʱ ' is Unreco

Source: Internet
Author: User

Loading class ' Com.mysql.jdbc.Driver '. This is deprecated. The new driver class is ' com.mysql.cj.jdbc.Driver '. The driver is automatically registered via the SPI and manual loading to the driver class is generally.


Solution: In accordance with the prompts to change the driver to Com.mysql.cj.jdbc.Driver can be, even if not changed to run the correct, but will complain


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 (the server Time zone value ' Й׼ʱ ' are unrecognized or represents more than one time zone. You are must configure either the server or JDBC driver (via the Servertimezone configuration) to use a more specifc Time zone value if your want to utilize time zone support.)


Solution: Unable to resolve the time zone, this does not solve the results of the operation, the solution is in the original statement after the "? Servertimezone=utc"


<  Bean     ID   = "DataSource"   class   = "Org.apache.commons.dbcp.BasicDataSource"  >  Property   Name   = "Driverclassname"   value   = " Com.mysql.cj.jdbc.Driver  ></ Property  >  Property   Name   = "url"   value   = "Jdbc:mysql://127.0.0.1:3306/myschool? SERVERTIMEZONE=UTC  ></ Property  >  Property   name
     = "username"   value   = "root"  ></ Property  >  Property   name   = "password"   value   = "root"  ></ Property  > </ Bean 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.