Skip to content
Snippets Groups Projects
Commit e6a905df authored by Hidayatullah Wildan Ghaly Buchary's avatar Hidayatullah Wildan Ghaly Buchary
Browse files

feat: add desc command on gethistoryserviceimpl

parent a6fe3814
Pipeline #59681 canceled with stages
...@@ -68,7 +68,7 @@ public class getHistoryServiceImpl implements getHistoryService { ...@@ -68,7 +68,7 @@ public class getHistoryServiceImpl implements getHistoryService {
Connection connection = db.getConnection(); Connection connection = db.getConnection();
System.out.println(restId); System.out.println(restId);
try { try {
String query = "SELECT * FROM history WHERE user_id = ? ORDER BY timestamp LIMIT 50"; String query = "SELECT * FROM history WHERE user_id = ? ORDER BY timestamp DESC LIMIT 50";
PreparedStatement preparedStatement = connection.prepareStatement(query); PreparedStatement preparedStatement = connection.prepareStatement(query);
preparedStatement.setInt(1, restId); preparedStatement.setInt(1, restId);
ResultSet result = preparedStatement.executeQuery();; ResultSet result = preparedStatement.executeQuery();;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment