随笔分类 - Java
摘要:Mybatis-Spring 1.准备JAR包 略 2.编写配置文件 在类路径下建立下面几个文件 # db.properties jdbc.driver=com.mysql.jdbc.Driver jdbc.url=jdbc:mysql://localhost:3306/mybatis jdbc.u
阅读全文
摘要:MyBatis关系映射 1.一对一 ①嵌套查询 <!--IdCardMapper.xml--> <mapper namespace="com.itheima.mapper.IdCardMapper"> <select id="findCodeById" parameterType="Integer"
阅读全文
摘要:动态SQL 1.元素 元素 说明 <if> 判断语句 <choose>(<when>、<otherwise>) 相当于switch...case...default <where>、<tirm>、<set> 辅助元素,用于一些SQL的拼装、特殊字符问题 <foreach> 循环语句,常用于in子句
阅读全文
摘要:MyBatis核心配置 1.SqlSessionFactory Reader reader = Resources.getResourceAsReader("mybatis-config.xml"); SqlSessionFactory sqlSessionFactory = new SqlSess
阅读全文
摘要:MyBatis入门 1.环境搭建 https://github.com/mybatis-3/releases 下载 ① maven依赖 <!--MyBatis 3.4.2 --> <dependency> <groupId>org.mybatis</groupId> <artifactId>myba
阅读全文
摘要:记录一些JAR包(...持续更新) MySQL <!--MySQL --> <!--Driver:com.mysql.jdbc.Driver--> <dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</arti
阅读全文
摘要:Sping AOP 1.什么是AOP 面向切面编程(AOP) 是 面向对象编程的补充(OOP) 传统的业务处理代码中,通常会惊醒事务处理、日志处理等操作。虽然可以使用OOP的组合或继承来实现代码重用,但如果要实现某个功能,同样的代码还是会分散到各个方法中。 如果想要关闭某个功能,或者修改,就必须修改
阅读全文
摘要:Spring的安装 Spring框架包 spring-framework-4.3.6RELEASE-dist.zip http://repo.spring.io/simple/libs-release-local/org/springframework/spring/4.3.6RELEASE/ 我们
阅读全文
摘要:Spring中的Bean 普通的Bean xml配置文件 <bean id="bean1" class="包名.类名"/> 实例化方法 1.构造器实例化 ApplicationContext applicationContext = new ClassPathXmlApplicationContex
阅读全文

浙公网安备 33010602011771号