资源简介
SpringBoot-mybatis登录、注册、拦截器、文件系统
SpringBoot-mybatis登录、注册、拦截器、文件系统
SpringBoot-mybatis登录、注册、拦截器、文件系统
代码片段和文件信息
package com.fxy;
import javax.sql.DataSource;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.ImportResource;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableScheduling;
import com.alibaba.druid.pool.DruidDataSource;
@SpringBootApplication
@ImportResource(locations={“classpath:mykaptcha.xml“})
@ComponentScan
@EnableAutoConfiguration
@EnableScheduling
@Configuration
public class DemoThreeApplication {
public static void main(String[] args) {
SpringApplication.run(DemoThreeApplication.class args);
}
@Autowired
private Environment env;
//destroy-method=“close“的作用是当数据库连接不使用的时候就把该连接重新放到数据池中方便下次使用调用.
@Bean(destroyMethod = “close“)
public DataSource dataSource() {
DruidDataSource dataSource = new DruidDataSource();
dataSource.setUrl(env.getProperty(“spring.datasource.url“));
dataSource.setUsername(env.getProperty(“spring.datasource.username“));//用户名
dataSource.setPassword(env.getProperty(“spring.datasource.password“));//密码
dataSource.setDriverClassName(env.getProperty(“spring.datasource.driver-class-name“));
dataSource.setInitialSize(2);//初始化时建立物理连接的个数
dataSource.setMaxActive(20);//最大连接池数量
dataSource.setMinIdle(0);//最小连接池数量
dataSource.setMaxWait(60000);//获取连接时最大等待时间,单位毫秒。
dataSource.setValidationQuery(“SELECT 1“);//用来检测连接是否有效的sql
dataSource.setTestOnBorrow(false);//申请连接时执行validationQuery检测连接是否有效
dataSource.setTestWhileIdle(true);//建议配置为true,不影响性能,并且保证安全性。
dataSource.setPoolPreparedStatements(false);//是否缓存preparedStatement,也就是PSCache
return dataSource;
}
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-03-09 10:40 demoThree\
文件 1239 2018-03-09 11:05 demoThree\.classpath
文件 249 2018-02-27 06:50 demoThree\.gitignore
目录 0 2018-02-27 14:49 demoThree\.mvn\
目录 0 2018-02-27 14:49 demoThree\.mvn\wrapper\
文件 47610 2018-02-27 06:50 demoThree\.mvn\wrapper\maven-wrapper.jar
文件 110 2018-02-27 06:50 demoThree\.mvn\wrapper\maven-wrapper.properties
文件 1426 2018-02-28 15:59 demoThree\.project
目录 0 2018-02-27 15:15 demoThree\.settings\
文件 639 2018-02-27 14:50 demoThree\.settings\.jsdtscope
文件 155 2018-02-28 09:37 demoThree\.settings\org.eclipse.core.resources.prefs
文件 430 2018-02-27 14:49 demoThree\.settings\org.eclipse.jdt.core.prefs
文件 90 2018-02-27 14:49 demoThree\.settings\org.eclipse.m2e.core.prefs
文件 668 2018-02-28 09:38 demoThree\.settings\org.eclipse.wst.common.component
文件 252 2018-02-27 14:50 demoThree\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2018-02-27 14:50 demoThree\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2018-02-27 14:50 demoThree\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 50 2018-02-27 14:49 demoThree\.settings\org.eclipse.wst.validation.prefs
文件 158 2018-02-27 15:15 demoThree\.settings\org.springfr
文件 2053 2018-03-03 10:00 demoThree\filesystem.sql
目录 0 2018-03-07 20:24 demoThree\log\
文件 1675138 2018-03-09 11:10 demoThree\log\myspringboot.log
文件 10488019 2018-03-07 20:24 demoThree\log\myspringboot.log.1
文件 14896 2018-03-01 09:27 demoThree\main.jsp
文件 6468 2018-02-27 06:50 demoThree\mvnw
文件 4994 2018-02-27 06:50 demoThree\mvnw.cmd
文件 3969 2018-03-09 11:03 demoThree\pom.xm
文件 2184 2018-03-02 17:56 demoThree\README.txt
目录 0 2018-02-27 14:49 demoThree\src\
目录 0 2018-03-05 10:58 demoThree\src\main\
目录 0 2018-02-27 14:49 demoThree\src\main\java\
............此处省略338个文件信息
相关资源
- SpringBoot+mybatis登录注册及其账号密码
- 安卓小东西
- 安卓 简单登录注册界面
- 安卓app——实现登录注册
- ajax+controller+Mybatis实现登录注册、修改
- 一款基于Litepal的登录注册app(可完美
- IDEA搭建SSM实现登录、注册,增删改查
- 人脸识别登录注册
- .net三层架构登录注册源码母版页的使
- ssm登录注册增删改查
- MVP模式用户登录注册功能
- 用户登录注册项目-ssh框架
- idea整合ssm框架实现登录注册退出增删
- ssh框架整合增删改查登录注册
- js css 实现的登录注册页面
- 好看的登录注册界面
- struts2+hibernate整合实现登录注册功能
- SSM框架技术增删改查注册登录的简单
- springboot 登录注册
- htm5css3做的登录注册
- 基于Flask的留言板Demo
- myEclipse做的登录注册
- :实现最新版本Node.js中Express+mongodb的
- Bootstrap4响应式登录注册界面模板
- struts1实现用户登录注册
- Spring Boot简单登录注册demo
- SSM整合进阶之---简单登录注册demo
- jfinal框架之登录注册的项目
- ajax实现用户登录注册
- 简易Qt登录注册及登陆后菜单功能程序
评论
共有 条评论