随笔分类 - iBatis
摘要:01_8_sql主键生成方式 1. 配置映射文件 <insert id="insertStudentBySequence" parameterClass="Student"> <selectKey resultClass="int" keyProperty="sid"> select student
阅读全文
摘要:01_7_模糊查询实体对象 1. 配置映射文件 <select id="selectStudentByName" parameterClass="String" resultClass="Student"> select * from Student where name like '%$name$
阅读全文
摘要:01_6_修改实体对象 1. 配置相应的映射文件 <update id="updateStudentById" parameterClass="Student"> update student set name=#name#, major=#major#, score=#score#, birth=
阅读全文
摘要:01_5_删除指定id的单个对象 1. 配置相应的映射文件内容 <delete id="deleteStudent" parameterClass="int"> delete from student where sid=#sid# </delete> 2. 实现类的方法 public void d
阅读全文
摘要:01_4_插入一个实体对象 1. 配置映射配置 <insert id="insertStudent" parameterClass="Student"> insert into Student(sid, name, major, birth, score) values(#sid#, #name#,
阅读全文
摘要:01_3_查询指定id的单个对象 1. 映射文件配置如下信息 <select id="selectStudentById" resultClass="Student" parameterClass="int"> select sid, name, major, birth, score from s
阅读全文
摘要:01_2_查询所有的对象 1. 实体类 package entity; import java.util.Date; public class Student { private int sid = 0; private String name = null; private String majo
阅读全文
摘要:01_1_准备ibatis环境 1. 搭建环境:导入相关的jar包 mysql-connector-java-5.1.5-bin.jar(mysql)或者ojdbc6.jar(oracle)、ibatis-2.3.3.720.jar 2. 配置文件 2.1jdbc连接的属性文件 SqlMap.pro
阅读全文
摘要:https://blog.csdn.net/k_scott/article/details/8281837 ###首先创建数据库表,然后根据数据库表,生成相应的实体、及其配置文件 https://www.cnblogs.com/spring-huangcheng/archive/2013/03/16
阅读全文
摘要:https://www.w3cschool.cn/ibatis/7lgy1rlo.html
阅读全文

浙公网安备 33010602011771号