|
|
@ -350,4 +350,68 @@ public class Games { |
|
|
|
|
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
public String checkConsolePlayStation() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
|
|
|
|
|
try { |
|
|
|
Connection connection = DriverManager.getConnection(databaseURL); |
|
|
|
|
|
|
|
Statement statement = connection.createStatement(); |
|
|
|
ResultSet resultSet = statement.executeQuery(query); |
|
|
|
|
|
|
|
while (resultSet.next()) { |
|
|
|
String gameName = resultSet.getString("Game_Name"); |
|
|
|
String gameConsole = resultSet.getString("Game_Console"); |
|
|
|
|
|
|
|
if (gameConsole.length() > 11) { |
|
|
|
if (gameConsole.substring(0, 11).equals("PlayStation")) { |
|
|
|
result += gameName + ", "; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
statement.close(); |
|
|
|
connection.close(); |
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
public String checkConsoleNintendo() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
|
|
|
|
|
try { |
|
|
|
Connection connection = DriverManager.getConnection(databaseURL); |
|
|
|
|
|
|
|
Statement statement = connection.createStatement(); |
|
|
|
ResultSet resultSet = statement.executeQuery(query); |
|
|
|
|
|
|
|
while (resultSet.next()) { |
|
|
|
String gameName = resultSet.getString("Game_Name"); |
|
|
|
String gameConsole = resultSet.getString("Game_Console"); |
|
|
|
|
|
|
|
if (gameConsole.length() > 8) { |
|
|
|
if (gameConsole.substring(0, 8).equals("Nintendo")) { |
|
|
|
result += gameName + ", "; |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
statement.close(); |
|
|
|
connection.close(); |
|
|
|
|
|
|
|
} catch (SQLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
} |