05 2020 档案
摘要:在项目中,有时候需要把数据直接显示到页面上,这可以使用request的请求转发 @RequestMapping(value="/xx") public void info(HttpServletRequest request, HttpServletResponse response){ Strin
阅读全文
摘要:项目中,通过mybatis对数据库进行insert插入数据库时,一般成功插入后返回int类型的插入数据条数(一般为1),但是有时候需要这新增数据的主键,以便后续其他数据需要使用,若是再重新查数据库,效率变低了 可以使用selectKey,mybatis可以将insert的数据的主键返回,直接拿到新增
阅读全文
摘要:Mysql API文档 https://dev.mysql.com/doc/refman/5.7/en/information-functions.html#function_last-insert-id
阅读全文
摘要:var id = document.getElementId("id"); if(typeof(id) == "undefined" || id == null) { console.log("节点不存在"); else{ console.log("节点存在"); } 注意:typeof(id) =
阅读全文
摘要:一、java设计模式分类 java设计模式分为3大类: 1、创建型模式(5):工厂方法模式、抽象工厂模式、单例模式、建造者模式、原型模式 工厂方法模式:定义一个用于创建对象的接口,让子类决定将哪一个类实例化。Factory Method使一个类的实例化延迟到其子类。 抽象工厂模式:提供一个创建一系列
阅读全文
摘要:在项目中有时需要配置.property文件 如 xx.properties配置文件中有数据: class.name=com.Fruit class.field=pulp class.method=eat 1、项目工程中使用注解@Value方式 在web项目工程中可以通过@Value("${xx.xx
阅读全文
摘要:一条select语句的执行阶段是有顺序的 select <select> from <table> [<left right join> <talbe> on <on>] where <where> group by <group> having <having> order by <order>
阅读全文