修正了添加和修改的影响行判定错误
This commit is contained in:
@@ -42,7 +42,7 @@ public class QuestionsDao {
|
||||
return questionPoList;
|
||||
}
|
||||
public List<Questions> getByCondition(Integer frequency,String key) {
|
||||
List<Questions> wordPoList = null;
|
||||
List<Questions> questionPoList = null;
|
||||
//1. 从连接池中拿到连接
|
||||
Connection conn = DBConnectionPool.getConnection();
|
||||
if(conn==null)
|
||||
@@ -57,7 +57,7 @@ public class QuestionsDao {
|
||||
if(frequency != null)
|
||||
stmt.setInt(2, frequency);
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
wordPoList=commonResultSet(rs);
|
||||
questionPoList =commonResultSet(rs);
|
||||
rs.close();
|
||||
stmt.close();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class QuestionsDao {
|
||||
}finally {
|
||||
DBConnectionPool.releaseConnection(conn);
|
||||
}
|
||||
return wordPoList;
|
||||
return questionPoList;
|
||||
}
|
||||
|
||||
public boolean insert(Questions question){
|
||||
@@ -91,7 +91,7 @@ public class QuestionsDao {
|
||||
}finally {
|
||||
DBConnectionPool.releaseConnection(conn);
|
||||
}
|
||||
return row > 1;
|
||||
return row > 0;
|
||||
}
|
||||
public boolean delete(Integer id){
|
||||
int row = 0;
|
||||
@@ -112,7 +112,7 @@ public class QuestionsDao {
|
||||
}finally {
|
||||
DBConnectionPool.releaseConnection(conn);
|
||||
}
|
||||
return row > 1;
|
||||
return row > 0;
|
||||
}
|
||||
public boolean updata(Questions question){
|
||||
int row = 0;
|
||||
@@ -137,7 +137,7 @@ public class QuestionsDao {
|
||||
}finally {
|
||||
DBConnectionPool.releaseConnection(conn);
|
||||
}
|
||||
return row > 1;
|
||||
return row > 0;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user