一、问题描述
在使用Springboot快速框架开发项目时,数据源依赖必不可少,比如你选择了mysql依赖,在项目创建成功之后,启动Springboot启动类可能会报以下数据源相关的异常。
错误日志如下:
Description:
Failed to configure a DataSource: 'url' attribute is not specified and no embedded datasource could be configured.
Reason: Failed to determine a suitable driver class
Action:
Consider the following:
If you want an embedded database (H2, HSQL or Derby), please put it on the classpath.
If you have database settings to be loaded from a particular profile you may need to activate it (no profiles are currently active).
二、SpringBoot启动类
package com.thinkingcao;
import org.spring