admin管理员组

文章数量:1571330

参考,SpringBoot配置DataSource(简述版)_HD243608836的博客-CSDN博客

 

安装上述配置方式可能遇到的问题

  1. 出现一下提示
***************************
APPLICATION FAILED TO START
***************************

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 (the profiles dev are currently active).

没有进入对应的驱动,比如需要用dbcp2的数据源那么就要在pom里面引入以下依赖

 
  1.  <!-- 添加DBCP2依赖 -->

  2.         <dependency>

  3.             <groupId>org.apachemons</groupId>

  4.             <artifactId>commons-dbcp2</artifactId>

  5.         </dependency>

本文标签: 数据源SpringBoot