affichebo.java

来自「一个毕业设计网络招标系统实现了招标的业务逻辑内含了数据库sql server备份」· Java 代码 · 共 65 行

JAVA
65
字号
package com.BO;

import java.sql.*;
import java.util.*;
import com.CDB.*;
import com.VO.*;

public class afficheBO {
	dataBase db;

	public afficheBO() {
		db = new dataBase();
	}

	public ArrayList affiche() {
		ArrayList list = new ArrayList();
		String sql = "select *from afiche";
		ResultSet rs = db.sqlFind(sql);
		try {
			while (rs.next()) {
				String affiche_id = rs.getString(1);

				String afficheTitle = rs.getString(2);
				String afficheContent = rs.getString(3);
				String afficheTime = rs.getString(4);
				String managerID = rs.getString(5);
				afficheVO vo = new afficheVO();
				vo.setAffiche_id(affiche_id);

				vo.setAfficheTitle(afficheTitle);
				vo.setAfficheContent(afficheContent);
				vo.setAfficheTime(afficheTime);
				vo.setManagerID(managerID);

				list.add(vo);
				System.out.println(list.size());
			}
		} catch (Exception e) {
			System.out.println("affiche Error !!" + e.getMessage());
		}
		return list;
	}

	public boolean addffiche(String affiche, String afficheTextArea,
			String userTime, String username) {
		String sql = "insert afiche  values('" + affiche + "','"
				+ afficheTextArea + "','" + userTime + "','" + username + "')";
		try {
			sql = new String(sql.getBytes("ISO-8859-1"), "GB2312");

			db.sqlUpdata(sql);
		} catch (Exception e) {
			System.out.println("addfiche Error!!" + e.getMessage());
		}
		return true;
	}

	public boolean delaffiche(String affiche_id) {
		String sql = "delete afiche where affiche_id='" + affiche_id + "'";
		db.sqlUpdata(sql);
		return true;
	}

}

⌨️ 快捷键说明

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