int flag = dbo.executeUpdate(sql2);
if(flag == 1)
return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}
else{
int flag = dbo.executeUpdate(sql);
if(flag == 1)
return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}
}catch(Exception e){
e.printStackTrace();
return Constant.SYSTEM_ERROR;
}finally{
dbo.close();
}
}
public int addVote(int id,String item){
String sql = "update vote set "+item+"="+item+"+1 where id='"+id+"'";
DBO dbo = new DBO();
dbo.open();
try{
int flag = dbo.executeUpdate(sql);
if(flag == 1)
return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}catch(Exception e){
e.printStackTrace();
return Constant.SYSTEM_ERROR;
}finally{
dbo.close();
}
}
public int addMemAff(String content,String type){
String sql = "insert into memaff(content,type,addtime) values('"+content+"','"+type+"','"+date+"')";
DBO dbo = new DBO();
dbo.open();
try{
int flag = dbo.executeUpdate(sql);
if(flag == 1)
return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}catch(Exception e){
e.printStackTrace();
return Constant.SYSTEM_ERROR;
}finally{
dbo.close();
}
}
public List getAllMemAff(){
String sql = "select * from memaff order by id desc ";
DBO dbo = new DBO();
list = new ArrayList();
dbo.open();
try{
rs = dbo.executeQuery(sql);
while(rs.next()){
List list2 = new ArrayList();
list2.add(rs.getInt(1));
list2.add(rs.getString(2));
list2.add(rs.getString(3));
list2.add(rs.getString(4));
list.add(list2);
}
return list;
}catch(Exception e){
e.printStackTrace();
return list;
}finally{
dbo.close();
}
}
///删除 public int delMemAff(int id){
String sql = "delete from memaff where id='"+id+"'";
DBO dbo = new DBO();
dbo.open();
try{
int flag = dbo.executeUpdate(sql);
if(flag == 1)
return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}catch(Exception e){
e.printStackTrace();
return Constant.SYSTEM_ERROR;
}finally{
dbo.close();
}
} public List getAllMemAff(String type){
String sql = "select content,addtime from memaff where type='"+type+"' order by id desc ";
DBO dbo = new DBO();
list = new ArrayList();
dbo.open();
try{
rs = dbo.executeQuery(sql);
while(rs.next()){
List list2 = new ArrayList();
list2.add(rs.getString(1));
list2.add(rs.getString(2));
list.add(list2);
}
return list;
}catch(Exception e){
e.printStackTrace();
return list;
}finally{
dbo.close();
}
}
}
【计算机毕业设计论文分享 计算机毕业论文范文】
推荐阅读
- 额定功率、实际功率 测小灯泡的电功率
- 行为偏差高中学生个案分析 学生个案分析
- 妇科炎症吃什么药好,辨清类型再开方 妇科炎症吃什么药好
- 今日立夏,为何立夏节气要吃鸡蛋 立夏为什么要吃蛋
- 2月杭州TOP10酒店 杭州酒店查询
- 最值得看的5部穿越剧 关于穿越时空的电视剧
- 野炊、露营、星空,这才是夏天最正确的玩法 野炊露营
- 2021最洋气的减龄发型图片 短发什么发型好看
- 可还记得QQ游戏大厅? qq游戏论坛