sqlserver问题
程序员文章站
2024-03-21 17:36:34
...
问题如下:
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
2020-03-14 13:00:33.553 ERROR 9240 --- [ restartedMain] o.s.b.d.LoggingFailureAnalysisReporter :
***************************
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 (no profiles are currently active).
解决方案:
加上(exclude = DataSourceAutoConfiguration.class)
package com.pbm;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.scheduling.annotation.EnableScheduling;
@EnableScheduling //即可开启定时
@SpringBootApplication(exclude = DataSourceAutoConfiguration.class)
public class WebApplication {
public static void main(String[] args) {
SpringApplication.run(WebApplication.class, args);
}
}
拓展知识:
依赖包
<!-- sqlserver驱动 -->
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<!-- jdbc -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
推荐阅读
-
关于AnacondaNavigator Jupyter Notebook更换Python内核的问题
-
做无货源平台选择是大事,你担心的问题,抖音小店一招帮你解决
-
抖音小店无货源,常见疑惑问题解答,解决方法
-
iphone蓝牙搜不到beats(一招解决手机蓝牙耳机问题)
-
产品面试问题:二次元用户需求挖掘与抖音评论逻辑
-
苹果终于承认iPhone12绿屏问题,检测和解决办法公布
-
阴阳屏再现,iPhone12屏幕出现问题,苹果似乎被LG坑了
-
一般产品面试问题和答案(面试考题及必备技能)
-
sqlserver客户端连接工具有哪些(配置sqlserver链接服务器)
-
iPhone12连5G耗电快 苹果三大短板导致问题爆发