有时要为每一篇文章统计其点击次数,如果每一次浏览都要更新一次库的话,那性能在访问量很大的情况下,服务器的压力就会很大了,比较好一点的方法就是先将要更新的数据缓存起来,然后每隔一段时间再利用数据库的批量处理,批量更新库。源码如下: nEM>*;iE
81|Xg5g)b
CountBean.java `MtPua\_
rE
bC_<
/* pcw^W
* CountData.java ArUGa(;f
* n(b(H`1n
* Created on 2007年1月1日, 下午4:44 5Qik{cWxBq
* 5"5D(
* To change this template, choose Tools | Options and locate the template under Rt<8&.m4
* the Source Creation and Management node. Right-click the template and choose *Ki ],>_~
* Open. You can then make changes to the template in the Source Editor. j#b?P=|l
*/ |Y!#`
Q+[e)YO)
package com.tot.count; +QIM~tt)
^Q]*CU+C
/** gaC^<\J
* H85HL-{
* @author hp}J_/+4n
*/ lu(<(t,Lbs
public class CountBean { /)xG%J7H
private String countType; dm&