SpringBoot的启动项程序和Application.properties核心配置文件的编写

1.首先导入SpringBoot的坐标和Spring Data Jpa 的坐标。百度一下多滴很
2.SpringBoot的核心配置文件Application.properties

#DB Configuration  数据源的配置
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/user?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT
spring.datasource.username=root
spring.datasource.password=root
#JPA Configuration JPA的配置
spring.jpa.database=MySQL
#将show-sql改成true,log才会输出sql语句,便于调试。打印sql语句
spring.jpa.show-sql=true 
#generate-ddl: false表示sping启动的时候不自动生成增删改查接口(因为##我们自己会写增删改查接口)。
spring.jpa.generate-ddl=true

3.SpringBoot的启动程序

 * 启动程序
 */
@SpringBootApplication
public class CrawlerApplication {
    public static void main(String[] args) {
        //注意上面引入的注解是@SpringBootApplication 启动程序是SpringApplication.run(类加载器)
        SpringApplication.run(CrawlerApplication.class,args);
        System.out.println("(♥◠‿◠)ノ゙  天海爬虫启动成功   ლ(´ڡ`ლ)゙" +
                        "  ____ ____      ___        ___     _____ ____      \n" +
                        " / ___|  _ \\    / \\ \\      / / |   | ____|  _ \\ \n" +
                        "| |   | |_) |  / _ \\ \\ /\\ / /| |   |  _| | |_) |\n" +
                        "| |___|  _ <  / ___ \\ V  V / | |___| |___|  _ < \n" +
                        " \\____|_| \\_\\/_/   \\_\\_/\\_/  |_____|_____|_| \\_\\\n" +
                        "                                                "
                );
    }
}```

推荐一个文字字符生成器:https://tools.kalvinbg.cn/txt/ascii

//                          _ooOoo_                               //
//                         o8888888o                              //
//                         88" . "88                              //
//                         (| ^_^ |)                              //
//                         O\  =  /O                              //
//                      ____/`---'\____                           //
//                    .'  \\|     |//  `.                         //
//                   /  \\|||  :  |||//  \                        //
//                  /  _||||| -:- |||||-  \                       //
//                  |   | \\\  -  /// |   |                       //
//                  | \_|  ''\---/''  |   |                       //
//                  \  .-\__  `-`  ___/-. /                       //
//                ___`. .'  /--.--\  `. . ___                     //
//              ."" '<  `.___\_<|>_/___.'  >'"".                  //
//            | | :  `- \`.;`\ _ /`;.`/ - ` : | |                 //
//            \  \ `-.   \_ __\ /__ _/   .-` /  /                 //
//      ========`-.____`-.___\_____/___.-`____.-'========         //
//                           `=---='                              //
//      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^        //
//             佛祖保佑       永不宕机      永无BUG                 //

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值