有时要为每一篇文章统计其点击次数,如果每一次浏览都要更新一次库的话,那性能在访问量很大的情况下,服务器的压力就会很大了,比较好一点的方法就是先将要更新的数据缓存起来,然后每隔一段时间再利用数据库的批量处理,批量更新库。源码如下: :=?od
0]W
&~V6g(9
CountBean.java COH9E\ZGF
tvcM<
e20
/* -Ra-Ux
* CountData.java _<u>?
Qt
* W%@0Y m`7
* Created on 2007年1月1日, 下午4:44
?)2; W
* ~n;U5hcB
* To change this template, choose Tools | Options and locate the template under `]4tJJy$
* the Source Creation and Management node. Right-click the template and choose .f9&.H#
* Open. You can then make changes to the template in the Source Editor. J[al4e^
*/ IVso/!
{sF;R.P&r
package com.tot.count; gB])@O%/
?U3~rro!
/** YQ`88z
* e4<St`K
* @author o#hFK'&~
*/ TJUYd9O4[
public class CountBean { ?0?+~0sI
private String countType; bKQ_{cR
int countId; .5!Q(
/** Creates a new instance of CountData */ #B5-3CwB
public CountBean() {} ~\u~>mtchu
public void setCountType(String countTypes){ r#(*x 2~,
this.countType=countTypes; FL[w\&fp
} C ett*jm_
public void setCountId(int countIds){ <q:2' 4o
this.countId=countIds; Ws:+P~8
} LCMn9I
public String getCountType(){ Ygc.0VKMR
return countType; y4,t=Gq7^
} mV.26D<c
public int getCountId(){ +r$VrNVs
return countId; &H/3@A3
} qRCUkw} fs
} 9j<