项目中不需要连接数据库,启动后报错信息如下:
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) { &...
public class test { public static void main(String[] args) { &...
java一个类可以有多个构造方法,根据传参类型和个数来匹配执行哪个构造方法。public class Member { public Member(){  ...
(1).java获取当前日期时间Date date = new Date(); System.out.println(date.toString());输出Fri Jul 02 10:29:55 CST 2021(2).java获取时间戳秒/毫秒D...
System.out.println("当前时间戳(秒): " + System.currentTimeMillis()/1000); System.out.println("当前时间戳(毫秒): " +&nb...
java正则表达式的捕获组捕获组可以将匹配到的结果根据正则中的括号进行分组,这里变量我加了$符,php转java的坏习惯,懒得改了,能跑就行// 匹配字符串 String $line = "gaojiufeng 1994! ok?...