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