📄 affichebo.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -