forumnews.java

来自「一个用jsp写的完整的论坛源代码」· Java 代码 · 共 87 行

JAVA
87
字号
package com.bcxy.bbs.forum;

/**
 * Title:
 * Description:
 * Copyright:
 * Company: www.liyunet.com
 * 
 * @author lishujiang	
 * @version 1.0
 */

import com.bcxy.bbs.util.BBSConst;
import com.bcxy.db.JdbcWrapper;

public class ForumNews {
	private int id, boardid;

	private String title, content, username, addtime;

	public ForumNews() {
	}

	public ForumNews(int newsid) throws ForumNewsNotFoundException, Exception {
		JdbcWrapper jw = new JdbcWrapper("select * from " + BBSConst.TABLE_BBSNEWS
				+ " where id='" + newsid + "' order by id desc");
		if (jw.next()) {
			this.id = jw.getInt(1);
			this.boardid = jw.getInt(2);
			this.title = jw.getString(3);
			this.content = jw.getString(4);
			this.username = jw.getString(5);
			this.addtime = jw.getString(6);
		} else {
			throw new ForumNewsNotFoundException("没有找到论坛公告!ID=" + newsid);
		}
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getBoardid() {
		return this.boardid;
	}

	public void setBoardid(int boardid) {
		this.boardid = boardid;
	}

	public String getTitle() {
		return this.title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return this.content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getUserName() {
		return this.username;
	}

	public void setUserName(String username) {
		this.username = username;
	}

	public String getAddTime() {
		return this.addtime;
	}

	public void setAddTime(String addtime) {
		this.addtime = addtime;
	}
}

⌨️ 快捷键说明

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