@Test//改publicvoidtest(){
String sql ="update user set password = 666 where username = 'tom'";int count = template.update(sql);
System.out.println(count);}@Test//增publicvoidtest(){
String sql ="insert into user(username,password) values('Alice','77889')";int count = template.update(sql);
System.out.println(count);}@Test//删publicvoidtest(){
String sql ="delete from user where username = ?";int count = template.update(sql,"Alice");
System.out.println(count);}
2、queryForMap():将单一查询结果封装为map集合
@Testpublicvoidtest(){
String sql ="select * from user where username = ?";
Map<String, Object> tom = template.queryForMap(sql,"tom");
System.out.println(tom);}