项目中不需要连接数据库,启动后报错信息如下:
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
排除数据库自动配置:
在你的项目中,如果使用了@SpringBootApplication注解启动应用,可以通过排除特定的自动配置类来避免数据库相关的配置被加载。
例如,如果你使用 Java 配置,可以这样做:
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class})
public class YourApplication {
public static void main(String[] args) {
SpringApplication.run(YourApplication.class, args);
}
} public class test { public static void main(String[] args) { &...
java判断字符是否是一个字母System.out.println(Character.isLetter('a'));java判断字符是否是一个数字System.out.println(Character.isDigit('0'));java判断字符是否是一个空白Sy...
java stringBuffer(1).stringBuffer和stringBuilder区别stringBuffer是线程安全的,stringBuilder速度更快(2).简单的stringBuffer例子StringBuffer sBuffer = new&nb...
(1).java睡眠函数Thread.sleep(时间); //单位为毫秒(2).java睡眠函数例子Date dNow = new Date(); SimpleDateFormat ft = new&nbs...
System.out.println("当前时间戳(秒): " + System.currentTimeMillis()/1000); System.out.println("当前时间戳(毫秒): " +&nb...
pattern表示正则表达式,接收正则表达式作为参数例子:String content = "my name is gaojiufeng"; String pattern = "....