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){
推荐阅读
- 额定功率、实际功率 测小灯泡的电功率
- 行为偏差高中学生个案分析 学生个案分析
- 妇科炎症吃什么药好,辨清类型再开方 妇科炎症吃什么药好
- 今日立夏,为何立夏节气要吃鸡蛋 立夏为什么要吃蛋
- 2月杭州TOP10酒店 杭州酒店查询
- 最值得看的5部穿越剧 关于穿越时空的电视剧
- 野炊、露营、星空,这才是夏天最正确的玩法 野炊露营
- 2021最洋气的减龄发型图片 短发什么发型好看
- 可还记得QQ游戏大厅? qq游戏论坛