学习笔记——定义切面优先级 ;Spring中的JdbcTemplate;JdbcTemplate的常用API

学习笔记——定义切面优先级 ;Spring中的JdbcTemplate;JdbcTemplate的常用API

2023-01-18

一、定义切面优先级 

 1、语法:@Order(value=index)

①index是int类型,默认值是int可存储的最大值

②数值越小,优先级越高

二、Spring中的JdbcTemplate

1、JdbcTemplate简介

(1)Spring提供的JdbcTemplate是一个小型持久化层框架,简称Jdbc代码

Mybatis是一个半自动化的ORM持久化层框架

2、JdbcTemplate基本使用

(1)导入Jar包

    <dependencies>
        <!-- https://mvnrepository.com/artifact/org.springframework/spring-context -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>5.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework/spring-jdbc -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-jdbc</artifactId>
            <version>5.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/org.springframework/spring-orm -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>5.3.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/com.alibaba/druid -->
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>druid</artifactId>
            <version>1.1.10</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.26</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/junit/junit -->
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
    </dependencies>
hmoban主题是根据ripro二开的主题,极致后台体验,无插件,集成会员系统
自学咖网 » 学习笔记——定义切面优先级 ;Spring中的JdbcTemplate;JdbcTemplate的常用API