- 博客(14)
- 资源 (5)
- 收藏
- 关注
原创 Spring配置事务
一、采用的基本搭建环境:SpringMVC、MyBatis、MySQL、tomcat Spring事务管理分解了传统的全局事务管理和本地事务管理的劣势,使得在任何环境中都可以使用统一的事务管理模型,你可以写一次代码,然后在不同的环境从你的代码里面配置不同的事务管理策略,Spring提供两种事务管理策略:一种是声明式事务管理策略,另一种是编程式事务管理策略,这里主要介
2015-11-26 10:20:49 251
原创 GSON解析list
GSON转List代码示例:List modelList = gson.fromJson(json串, new TypeToken>(){}.getType());for(int i = 0; i System.out.println(modelList.get(i));}
2015-11-26 10:18:42 624
转载 mysql报错unknown/unsupported storage engine: InnoDB
mysql5.5.28错误unknown/unsupported storage engine: InnoDB环境:win7(x64)专业版一路安装后mysql后出现错误提示:unknown/unsupported storage engine: InnoDB;把my.ini的default-storage-engine=innoDB改为:MyISAM即可启动。
2015-11-23 15:59:31 3758
原创 JsonArray跟JsonObject用法
VenueOrderModel vt = new VenueOrderModel();vt.setCouponId(1L);vt.setUserId(2L);vt.setVenueId(2L);vt.setPayWay(4);vt.setPayPrice(5.8);vt.setOriginalPrice(6.6);List lv1 = new ArrayList();
2015-11-23 13:50:01 453
转载 jsonObject获取json串的值
String str="{"Date":"2012-1-4T00:00:00","keywords":null,"NeededString":"this is the sample string I am needed for my project","others":"not needed"}";JsonObject jobj=new JsonObject(str);String need
2015-11-21 20:07:25 707
原创 SQL 查询出两个字段相同的大于一行的数
Select userId,activityId From activity_users group by userId,activityId having count(*)>1
2015-11-21 12:37:57 2793
原创 sql select if使用方法
SELECT IF((SELECT COUNT(id) FROM activity_users WHERE userId=param_userId AND activityId =param_activityId)=0 OR (SELECT `status` FROM activity_users WHERE userId=param_userId AND activityId =param_ac
2015-11-21 11:02:56 4652
原创 js给li标签中的所有a标签加点击事件
javascript中$('#sportsItem2 a').click(function() {var $this = $(this);$ids = $this.attr("id");console.info($ids);$("#club-list").empty();$this.addClass("on").parents().siblings().chil
2015-11-18 15:57:06 8428
原创 监听器application级别获得bean方法
public void contextInitialized(ServletContextEvent sce) {BeanFactory beans = WebApplicationContextUtils.getWebApplicationContext(sce.getServletContext());dictionaryService = (IDictionaryService) b
2015-11-18 13:32:54 285
原创 Junit4+Spring单元测试写到类上面的注解
@RunWith(SpringJUnit4ClassRunner.class)@ContextConfiguration(locations = { "classpath:spring.xml", "classpath:spring-mybatis.xml" })public class PushLogControllerTest {}
2015-11-18 09:27:21 659
原创 mybatis 批量插入
INSERT INTO push_log(userId,msgId,title,isCheck,createBy,createTime) VALUES(${item.userId},${item.msgId},#{item.title},2,${item.createBy},now())
2015-11-17 17:24:19 260
原创 springMvc时间格式化model的时间字段上填写
@DateTimeFormat(pattern = "yyyy-MM-dd")@JsonFormat(pattern="yyyy-MM-dd",timezone="GMT+8")private Date craeteTime;
2015-11-16 10:42:57 1625
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人