数据库更新
This commit is contained in:
@@ -7,8 +7,6 @@ import org.apache.commons.dbutils.QueryRunner;
|
||||
import org.apache.commons.dbutils.handlers.BeanListHandler;
|
||||
|
||||
import java.sql.Connection;
|
||||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.List;
|
||||
|
||||
@@ -79,7 +77,7 @@ public class commentDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql = "select * from comment where projectId = ? and isValid = 1 Order BY creatTime ";
|
||||
String sql = "select * from comment where projectId = ? and isValid = 1 Order BY creatTime DESC;";
|
||||
commentEntityList = runner.query(conn, sql,new BeanListHandler<>(commentEntity.class),id);
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
|
@@ -242,7 +242,7 @@ public class projectDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql = "update project set starNum = starNum + 1 where isValid = 1 and projectId= ?";
|
||||
String sql = "update project set startNum = startNum + 1 where isValid = 1 and projectId= ?";
|
||||
num = runner.update(conn, sql,proId);
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
@@ -257,7 +257,7 @@ public class projectDao {
|
||||
try {
|
||||
Connection conn = JdbcUtils.getConnection();
|
||||
QueryRunner runner = new QueryRunner();
|
||||
String sql = "update project set starNum = starNum - 1 where isValid = 1 and projectId= ?";
|
||||
String sql = "update project set startNum = startNum - 1 where isValid = 1 and projectId= ?";
|
||||
num = runner.update(conn, sql,proId);
|
||||
conn.close();
|
||||
} catch (SQLException e) {
|
||||
|
Reference in New Issue
Block a user