计算机毕业设计论文分享 计算机毕业论文范文(15)


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();
}
}
}
【计算机毕业设计论文分享 计算机毕业论文范文】

推荐阅读