commit cd7d3dae4b01ff361c8cf2d0a23e145c4556503f
parent a2dd639b26e6066183b45cad1a27de3edb95b69b
Author: adglas21 <adamglasheen99@gmail.com>
Date: Thu, 28 Nov 2024 16:37:28 +0000
Petar's updated WS
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/TicTacToeWS/src/main/java/com/tttws/TicTacToeWS.java b/TicTacToeWS/src/main/java/com/tttws/TicTacToeWS.java
@@ -14,7 +14,7 @@ import jakarta.jws.soap.SOAPBinding;
/**
*
- * @author adam
+ * @author petar
*/
@WebService(serviceName = "TicTacToeWebService")
@@ -370,6 +370,8 @@ public class TicTacToeWS {
try {
String result = dao.retrieve(sqlCmd);
if(result.equals("1")) {
+ sqlCmd = "DELETE FROM moves WHERE gID = " + gid + ";"; // delete moves first
+ result = dao.remove(sqlCmd); // run the SQL statement
sqlCmd = "DELETE FROM games WHERE autokey = " + gid + ";";
result = dao.remove(sqlCmd);
return "1";
@@ -389,7 +391,6 @@ public class TicTacToeWS {
*/
@WebMethod(operationName = "showMyOpenGames")
public String showMyOpenGames(@WebParam(name = "uid") int uid) {
- System.out.println("Called showMyOpenGames()");
String sqlCmd = "SELECT g.autokey, u.username, g.started FROM games g, users u WHERE g.p1 = " + uid + " AND g.p2 IS NULL AND g.p1 = u.autokey ORDER BY g.started ASC;";
try {
String result = dao.retrieve(sqlCmd);