Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2017-06-15 15:04:37.122 ERROR 10072 --- [ restartedMain] o.s.boot.SpringApplication : Application startup failed
步骤一:在pom.xml文件中添加mysql和jpa的相关jar包依赖,具体添加位置在dependencies中,具体添加的内容如下所示。
spring-boot-starter-web
spring-boot-starter-data-jpa
mysql-connector-java
poi
步骤二:在application.properties配置文件中加入数据库的相关配置,配置信息如下所示。
spring.datasource.url = jdbc:mysql://localhost:3306/webtest
spring.datasource.username = root
spring.datasource.password = 220316
spring.datasource.driverclassname = com.mysql.jdbc.driver
# specify the dbms
spring.jpa.database = mysql
# show or not log for each sql query
spring.jpa.show-sql = true
# hibernate ddl auto (create, create-drop, update)
spring.jpa.hibernate.ddl-auto = update
# naming strategy
spring.jpa.hibernate.naming-strategy = org.hibernate.cfg.improvednamingstrategy
# stripped before adding them to the entity manager)
spring.jpa.properties.hibernate.dialect = org.hibernate.dial