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

📄 votedto.java

📁 教你一天学会struts
💻 JAVA
字号:
package com.soft136.strutsoneday.model;

import java.sql.SQLException;

import javax.sql.rowset.CachedRowSet;

import java.util.ArrayList;

import com.soft136.strutsoneday.dao.VoteDAO;

public class VoteDTO {

	public ArrayList<VoteBean> getVotes() throws SQLException,
			ClassNotFoundException {
		CachedRowSet crs = new VoteDAO().getVotes();
		if (crs != null) {
			ArrayList<VoteBean> list = new ArrayList<VoteBean>();
			while (crs.next()) {
				list.add(new VoteBean(crs.getInt(1), crs.getString(2), crs
						.getInt(3)));
			}
			return list;
		} else {
			return null;
		}
	}

	public void vote(int voteId) throws SQLException, ClassNotFoundException {
		new VoteDAO().vote(voteId);
	}

}

⌨️ 快捷键说明

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