有时要为每一篇文章统计其点击次数,如果每一次浏览都要更新一次库的话,那性能在访问量很大的情况下,服务器的压力就会很大了,比较好一点的方法就是先将要更新的数据缓存起来,然后每隔一段时间再利用数据库的批量处理,批量更新库。源码如下: G\Me%{b#
RY'y%6Z]ZO
CountBean.java 7XNfH@
j{g {`Qa
/* RA6D dqT~
* CountData.java VV
* xn"g_2Hi
* Created on 2007年1月1日, 下午4:44 <da! #12L
* _KFKx3<m!
* To change this template, choose Tools | Options and locate the template under F,sT[C
* the Source Creation and Management node. Right-click the template and choose
)nY/ RO
* Open. You can then make changes to the template in the Source Editor. 0e7!_/9
*/ ^!9b#Ja
PT;$@q8
package com.tot.count; C$bK!]a
g=pDC+
/** 4Qdg t*
* [V2l&ZUni
* @author SCjACQ}-
*/ (/Ubw4unI
public class CountBean { _VlNZ/V
private String countType; R8 m/Nt2
int countId; %;<