SpringBoot-mybatis登录、注册、拦截器、文件系统


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.mvnwrapper
     文件       47610  2018-02-27 06:50  demoThree.mvnwrappermaven-wrapper.jar
     文件         110  2018-02-27 06:50  demoThree.mvnwrappermaven-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.settingsorg.eclipse.core.resources.prefs
     文件         430  2018-02-27 14:49  demoThree.settingsorg.eclipse.jdt.core.prefs
     文件          90  2018-02-27 14:49  demoThree.settingsorg.eclipse.m2e.core.prefs
     文件         668  2018-02-28 09:38  demoThree.settingsorg.eclipse.wst.common.component
     文件         252  2018-02-27 14:50  demoThree.settingsorg.eclipse.wst.common.project.facet.core.xml
     文件          49  2018-02-27 14:50  demoThree.settingsorg.eclipse.wst.jsdt.ui.superType.container
     文件           6  2018-02-27 14:50  demoThree.settingsorg.eclipse.wst.jsdt.ui.superType.name
     文件          50  2018-02-27 14:49  demoThree.settingsorg.eclipse.wst.validation.prefs
     文件         158  2018-02-27 15:15  demoThree.settingsorg.springframework.ide.eclipse.boot.properties.editor.prefs
     文件        2053  2018-03-03 10:00  demoThreefilesystem.sql
     目录           0  2018-03-07 20:24  demoThreelog
     文件     1675138  2018-03-09 11:10  demoThreelogmyspringboot.log
     文件    10488019  2018-03-07 20:24  demoThreelogmyspringboot.log.1
     文件       14896  2018-03-01 09:27  demoThreemain.jsp
     文件        6468  2018-02-27 06:50  demoThreemvnw
     文件        4994  2018-02-27 06:50  demoThreemvnw.cmd
     文件        3969  2018-03-09 11:03  demoThreepom.xml
     文件        2184  2018-03-02 17:56  demoThreeREADME.txt
     目录           0  2018-02-27 14:49  demoThreesrc
     目录           0  2018-03-05 10:58  demoThreesrcmain
     目录           0  2018-02-27 14:49  demoThreesrcmainjava
............此处省略338个文件信息

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件举报,一经查实,本站将立刻删除。

发表评论

评论列表(条)