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


return Constant.SUCCESS;
else
return Constant.SYSTEM_ERROR;
}catch(Exception e){
e.printStackTrace();
return Constant.SYSTEM_ERROR;
}finally{
dbo.close();
}
}
// 删除
public int delVote(int id){
String sql = "delete from vote 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 getVote(int id){
String sql = "select * from vote where id='"+id+"' ";
DBO dbo = new DBO();
list = new ArrayList();
dbo.open();
try{
rs = dbo.executeQuery(sql);
while(rs.next()){
list.add(rs.getInt(1));
list.add(rs.getString(2));
list.add(rs.getString(3));
list.add(rs.getString(4));
list.add(rs.getString(5));
list.add(rs.getString(6));
list.add(rs.getString(7));
list.add(rs.getString(8));
list.add(rs.getString(9));
list.add(rs.getString(10));
list.add(rs.getString(11));
list.add(rs.getString(12));
list.add(rs.getString(13));
list.add(rs.getString(14));
list.add(rs.getString(15));
list.add(rs.getString(16));
}
return list;
}catch(Exception e){
e.printStackTrace();
return list;
}finally{
dbo.close();
}
}
// 查询所有
public List getAllVote(){
String sql = "select * from vote order by id desc ";
DBO dbo = new DBO();
list = new ArrayList();
dbo.o网pen();
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));
list2.add(rs.getString(5));
list2.add(rs.getString(6));
list2.add(rs.getString(7));
list2.add(rs.getString(8));
list2.add(rs.getString(9));
list2.add(rs.getString(10));
list2.add(rs.getString(11));
list2.add(rs.getString(12));
list2.add(rs.getString(13));
list2.add(rs.getString(14));
list2.add(rs.getString(15));
list2.add(rs.getString(16));
list.add(list2);
}
return list;
}catch(Exception e){
e.printStackTrace();
return list;
}finally{
dbo.close();
}
}
public List getVote(){
String sql = "select * from vote where ifhide='1' ";
DBO dbo = new DBO();
list = new ArrayList();
dbo.open();
try{
rs = dbo.executeQuery(sql);
while(rs.next()){
list.add(rs.getInt(1));
list.add(rs.getString(2));
list.add(rs.getString(3));
list.add(rs.getString(4));
list.add(rs.getString(5));
list.add(rs.getString(6));
list.add(rs.getString(7));
list.add(rs.getString(8));
list.add(rs.getString(9));
list.add(rs.getString(10));
list.add(rs.getString(11));
list.add(rs.getString(12));
list.add(rs.getString(13));
list.add(rs.getString(14));
list.add(rs.getString(15));
list.add(rs.getString(16));
}
return list;
}catch(Exception e){
e.printStackTrace();
return list;
}finally{
dbo.close();
}
}
// open.close vote
public int hideSurvey(int id){
String sql = "update vote set ifhide='1' where id='"+id+"'";
String sql2 = "update vote set ifhide='0' where id='"+id+"'";
String sql3 = "select ifhide from vote where id='"+id+"'";
DBO dbo = new DBO();
dbo.open();
try{
rs = dbo.executeQuery(sql3);
rs.next();
int i = rs.getInt(1);
if(i == 1){

推荐阅读