|
|
@ -11,7 +11,9 @@ public class Games { |
|
|
|
|
|
|
|
/** |
|
|
|
* Checks if the connection to the database can be established |
|
|
|
* @return Returns true if it connects successfully and false if the connection fails. |
|
|
|
* |
|
|
|
* @return Returns true if it connects successfully and false if the connection |
|
|
|
* fails. |
|
|
|
*/ |
|
|
|
public boolean checkConnection() { |
|
|
|
try { |
|
|
@ -26,7 +28,9 @@ public class Games { |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints the whole table for those, who cannot access the Database for some reason. |
|
|
|
* Prints the whole table for those, who cannot access the Database for some |
|
|
|
* reason. |
|
|
|
* |
|
|
|
* @return Returns a String of the whole table. |
|
|
|
*/ |
|
|
|
public String printTable() { |
|
|
@ -102,6 +106,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 1); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all game names from the table. |
|
|
|
* |
|
|
|
* @return Returns a String with the game names |
|
|
|
*/ |
|
|
|
public String checkGames() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name FROM Games"; |
|
|
@ -128,6 +137,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the consoles which are represented in the table. |
|
|
|
* |
|
|
|
* @return Returns a String with the consoles. |
|
|
|
*/ |
|
|
|
public String checkConsoles() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Console FROM Games"; |
|
|
@ -458,6 +472,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the games which are on a PlayStation console. |
|
|
|
* |
|
|
|
* @return Returns a String with the games from a PlayStation console. |
|
|
|
*/ |
|
|
|
public String checkConsolePlayStation() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
@ -490,6 +509,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the games which are on a Nintendo console. |
|
|
|
* |
|
|
|
* @return Returns a String with the games from a Nintendo console. |
|
|
|
*/ |
|
|
|
public String checkConsoleNintendo() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
@ -522,6 +546,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the games which are on a Xbox console. |
|
|
|
* |
|
|
|
* @return Returns a String with the games from a Xbox console. |
|
|
|
*/ |
|
|
|
public String checkConsoleXbox() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
@ -554,6 +583,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the games which are multiplatform. |
|
|
|
* |
|
|
|
* @return Returns a String with the multiplatform games . |
|
|
|
*/ |
|
|
|
public String checkConsoleMultiplatform() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
@ -586,6 +620,11 @@ public class Games { |
|
|
|
return result.substring(0, result.length() - 2); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* Prints out all of the games which are on a Nintendo Switch. |
|
|
|
* |
|
|
|
* @return Returns a String with the games from a Nintendo Switch. |
|
|
|
*/ |
|
|
|
public String checkConsoleNintendoSwitch() { |
|
|
|
String result = ""; |
|
|
|
String query = "SELECT Game_Name, Game_Console FROM Games"; |
|
|
|