文章分类 | 推荐文章 | 最新文章 | 热点文章 | 最新软件 | 国产软件 | 国外软件 | 汉化补丁 | 设为首页 | 加入收藏
业界资讯 | 图形图像 | 操作系统 | 网络冲浪 | 工具软件 | 办公软件 | 媒体动画 | 精文荟萃 | 认证考试 | 网站建设 | 技术开发 | 专栏
当前位置:abcdown网络学院网络编程JSPJSP高访问量下的计数程序
精品广告
推荐TOP10
·什么是 JSP 技术?
·JSP简介
·JSP数据库操作例程
·新手入门:学习JSP的经典的入门学习资料
·由浅入深学习动态网页制作PHP的编程与应用
·输入汉字自动转为拼音(jsp实现方式)
·经验分享 JSP程序员完全蜕变手册
·JSP实战:JBuilder2005中创建数据库表
·新手入门:JSP基本语法与简单表单处理
·使用技巧:在JSP页面中的应用JavaBean
阅读TOP10
·JSP和JSF双剑合并 打造完美Web应用
·Mysql与JSP网页中文乱码问题的解决方案
·jsp计数器-jsp文件
·JSP实现图形验证码-汉字
·用JSTL实现JSP应用程序快速开发
·使JSP/Servlet应用程序优化的八种方法
·jsp的八个隐含对象
·js asp c# 防止sql注入
·JSP应用语法详解大全 (3)
·使用JSP读取客户端信息

JSP高访问量下的计数程序

日期:2006年12月16日 作者: 查看:[大字体 中字体 小字体]


  有时要为每一篇文章统计其点击次数,如果每一次浏览都要更新一次库的话,那性能在访问量很大的情况下,服务器的压力就会很大了,比较好一点的方法就是先将要更新的数据缓存起来,然后每隔一段时间再利用数据库的批量处理,批量更新库。源码如下:

  CountBean.java

/*
* CountData.java
*
* Created on 2006年10月18日, 下午4:44
*
* To change this template, choose Tools Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/

  package com.tot.count;

/**
*
* @author http://www.tot.name
*/
public class CountBean {
 private String countType;
 int countId;
 /** Creates a new instance of CountData */
 public CountBean() {}
 public void setCountType(String countTypes){
  this.countType=countTypes;
 }
 public void setCountId(int countIds){
  this.countId=countIds;
 }
 public String getCountType(){
  return countType;
 }
 public int getCountId(){
  return countId;
 }
}

  CountCache.java

/*
* CountCache.java
*
* Created on 2006年10月18日, 下午5:01
*
* To change this template, choose Tools Options and locate the template under
* the Source Creation and Management node. Right-click the template and choose
* Open. You can then make changes to the template in the Source Editor.
*/

package com.tot.count;
import java.util.*;
/**
*
* @author http://www.tot.name
*/
public class CountCache {
 public static LinkedList list=new LinkedList();
 /** Creates a new instance of CountCache */
 public CountCache() {}
 public static void add(CountBean cb){
  if(cb!=null){
   list.add(cb);
  }
 }
}

 CountControl.java

 /*
 * CountThread.java
 *
 * Created on 2006年10月18日, 下午4:57
 *
 * To change this template, choose Tools Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose

[1] [2] [3] 下一页 

上一篇:XMLTextReader和XmlDocument读取XML文件的比较

下一篇:在CSS样式表里使用JavaScript


相关软件: 相关文章:
·Excel排序技巧两则
·关闭Windows Server 2003关机事件跟踪程序
·不用任何软件(木马程序)盗取账号密码
·删除Windows程序如何做到斩草除根
·C#中利用process类调用外部程序以及执行dos命令
·实现Repeater控件点击表头排序功能
·vBB, IPB, phpBB, Discuz, Snitz, WWF, Dvbbs七款论坛程序比较

特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
[打印本页] [关闭窗口] 转载请注明来源:http://www.abcdown.net
首页 | 本站声明 | 下载帮助 | 发布软件 |
中文版权所有:ABC学院 浙ICP备05000717号