⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 forumlinkfactory.java

📁 BBS论坛设计JSP+MYSQL
💻 JAVA
字号:
package com.bcxy.bbs.forum;
/**
 * Title:
 * Description:
 * Copyright:
 * Company: www.liyunet.com
 * 
 * @author lishujiang	
 * @version 1.0
 */
import java.util.Vector;

import com.bcxy.cache.CacheManager;
import com.bcxy.conf.ENV;
import com.bcxy.db.SqlQuery;

public class ForumLinkFactory{

	public static Vector getForumLinks() throws ForumLinkNotFoundException{
		try{
			SqlQuery rs=new SqlQuery("select * from bbslink order by id");
			
			Vector forumLinkVector=new Vector();
			while(rs.next()){
				ForumLink tempLink=new ForumLink();
				tempLink.setLinkID(rs.getInt(1));
				tempLink.setForumName(rs.getString(2));
				tempLink.setReadMe(rs.getString(3));
				tempLink.setForumURL(rs.getString(4));
				forumLinkVector.add(tempLink);
			}
			
			return forumLinkVector;
		}
		catch(Exception e){
			e.printStackTrace();
			throw new ForumLinkNotFoundException();
		}
	}
	public static ForumLink getForumLink(int forumLinkID) throws Exception{
		//
		ForumLink tempLink = (ForumLink)CacheManager.getCache(ENV.FORUM_LINK).get(String.valueOf(forumLinkID));
		if(tempLink==null){
    		SqlQuery rs=new SqlQuery("select * from bbslink  where id="+forumLinkID);
    		if(!rs.next()){
    			throw new Exception("对不起,没有发现此联盟论坛!");
    		}
    		tempLink=new ForumLink();
    		tempLink.setLinkID(rs.getInt(1));
    		tempLink.setForumName(rs.getString(2));
    		tempLink.setReadMe(rs.getString(3));
    		tempLink.setForumURL(rs.getString(4));
    		CacheManager.getCache(ENV.FORUM_LINK).put(String.valueOf(forumLinkID),tempLink);
		}
		return tempLink;
	}
}

			
		

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -