diff --git a/src/com/hellogithub/dao/AdminDao.java b/src/com/hellogithub/dao/AdminDao.java index 1e5b08c..1884ee2 100644 --- a/src/com/hellogithub/dao/AdminDao.java +++ b/src/com/hellogithub/dao/AdminDao.java @@ -125,7 +125,7 @@ public class AdminDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from admin where isValid = 1"; + String sql="select * from admin"; adminEntityList = runner.query(conn,sql,new BeanListHandler<>(adminEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/dao/UserDao.java b/src/com/hellogithub/dao/UserDao.java index 3e8def8..2987b45 100644 --- a/src/com/hellogithub/dao/UserDao.java +++ b/src/com/hellogithub/dao/UserDao.java @@ -64,7 +64,7 @@ public class UserDao { connection = JdbcUtils.getConnection(); // sql语句写的操作 ----加上事务 JdbcUtils.beginTransaction(connection); // 开启事务 - String insertSql = "INSERT INTO `user` (`userId`, `userName`, `userPassword`,`creatTime`,`isValid`,projectNum,contributionValue,userLevel,userAvatar) VALUES (null, ?, ?,?,1,0,0,1,'E://Desktop//helloGithub//web//uploadFile//69e56c15-20d5-43a4-916b-1d6230a33b8e_default.png');"; + String insertSql = "INSERT INTO `user` (`userId`, `userName`, `userPassword`,`creatTime`,`isValid`,projectNum,contributionValue,userLevel,userAvatar) VALUES (null, ?, ?,?,1,0,0,1,'\\\\helloGithub\\\\web\\\\uploadFile\\\\69e56c15-20d5-43a4-916b-1d6230a33b8e_default.png');"; preparedStatement = connection.prepareStatement(insertSql); preparedStatement.setString(1, userName); preparedStatement.setString(2, userPwd); @@ -388,7 +388,7 @@ public class UserDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from user where isValid = 1"; + String sql="select * from user "; userEntityList = runner.query(conn,sql,new BeanListHandler<>(userEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/dao/articleDao.java b/src/com/hellogithub/dao/articleDao.java index a051c10..43b465e 100644 --- a/src/com/hellogithub/dao/articleDao.java +++ b/src/com/hellogithub/dao/articleDao.java @@ -220,7 +220,7 @@ public class articleDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from article where isValid = 1"; + String sql="select * from article"; articleEntityList = runner.query(conn,sql,new BeanListHandler<>(articleEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/dao/categoryDao.java b/src/com/hellogithub/dao/categoryDao.java index 88f750c..f3f9b94 100644 --- a/src/com/hellogithub/dao/categoryDao.java +++ b/src/com/hellogithub/dao/categoryDao.java @@ -54,7 +54,7 @@ public class categoryDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from category where isValid = 1"; + String sql="select * from category "; categoryEntityList = runner.query(conn,sql,new BeanListHandler<>(categoryEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/dao/commentDao.java b/src/com/hellogithub/dao/commentDao.java index 6b69b6a..bcfa25b 100644 --- a/src/com/hellogithub/dao/commentDao.java +++ b/src/com/hellogithub/dao/commentDao.java @@ -114,7 +114,7 @@ public class commentDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from comment where isValid = 1"; + String sql="select * from comment "; commentEntityList = runner.query(conn,sql,new BeanListHandler<>(commentEntity.class)); } catch (SQLException e) { throw new RuntimeException(e); diff --git a/src/com/hellogithub/dao/projectDao.java b/src/com/hellogithub/dao/projectDao.java index e97f762..4957191 100644 --- a/src/com/hellogithub/dao/projectDao.java +++ b/src/com/hellogithub/dao/projectDao.java @@ -341,7 +341,7 @@ public class projectDao { try { Connection conn = JdbcUtils.getConnection(); QueryRunner runner = new QueryRunner(); - String sql="select * from project where isValid = 1"; + String sql="select * from project "; projectEntityList = runner.query(conn,sql,new BeanListHandler<>(projectEntity.class)); } catch (SQLException e) { throw new RuntimeException(e);