package cn.wzw; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; /** * SpringBoot工程都有的启动引导类,也是工程的入口类 * 注解为:@SqringBootApplication * main函数可以通过psvm这个快捷键实现 * main函数里面是要run这个application类 */ @SpringBootApplication public class Application { public static void main(String[] args){ SpringApplication.run(Application.class,args); } } package cn.wzw.controller; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.RestController; /** * controller就是处理器的意思,主要编写一些逻辑的代码 * 注解@RestController相当于@ResponseBody+@Controller * 返回的一定是字符串之类的 */ @RestController public class HelloController { @GetMapping("hello") public String hello(){ return "Hello,SpringBoot!"; } } <dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> <version>2.4.5</version> </dependency> </dependencies> package cn.wzw.config; import org.springframework.boot.context.properties.ConfigurationProperties; /** * 配置项类。 * 作用:从配置文件application中读取配置项 * prefix的作用:是前缀 * 配置项类中的类变量名必须与配置前缀之后的配置项名称保持 松散绑定(相同) */ @ConfigurationProperties(prefix = "jdbc") public class JdbcProperties { private String url; private String driverClassName; private String username; private String password; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getDriverClassName() { return driverClassName; } public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; } } @ConfigurationProperties(prefix = "jdbc") public class JdbcProperties { private String url; private String driverClassName; private String username; private String password; public String getUrl() { return url; } public void setUrl(String url) { this.url = url; } public String getDriverClassName() { return driverClassName; } public void setDriverClassName(String driverClassName) { this.driverClassName = driverClassName; } public String getUsername() { return username; } public void setUsername(String username) { this.username = username; } public String getPassword() { return password; } public void setPassword(String password) { this.password = password; }
Java单链表的实现方法汇总整理到此结束。