Mybatis操作数据库
select单条数据
查询一条数据
select多条数据
查询多条数据
insert数据
insert是用来插入(或添加)行到数据库表的。
插入可以用几种方式使用:
插入完整的行;
插入行的一部分;
插入多行;
插入某些查询的结果。
update
用途:更新表中原有数据
单独使用,使用where匹配字段set后面,更新字段值,既可以一次一项,也可以一次多项
delete
删除数据语法: delete表名 [WHERE <逻辑表达式>]
1
(1).删除所有数据
delete 表名 即可删除所有数据delete lead
(2)删除特定列的值
在删除语句中加入where语句可以使得删除特定的行
SpringMVC工程搭建
springmvc请求映射注解
mvc:annotation-driven</mvc:annotation-driven>
搭建配置springmvc
spring org.springframework.web.servlet.DispatcherServlet 1 spring .do org.springframework.web.context.ContextLoaderListener contextConfigLocation classpath:config/applicationContext.xml
编写代码测试
@RequestMapping(value=“user3/redirectUrl.do”)
public String redirectMethod(){ //return “redirect:/te