@ -32,48 +32,55 @@ public class Games {
ResultSet resultSet = statement . executeQuery ( query ) ;
ResultSet resultSet = statement . executeQuery ( query ) ;
while ( resultSet . next ( ) ) {
while ( resultSet . next ( ) ) {
int id = resultSet . getInt ( "Game_ID" ) ;
String gameName = resultSet . getString ( "Game_Name" ) ;
String gameConsole = resultSet . getString ( "Game_Console" ) ;
String gameDeveloper = resultSet . getString ( "Game_Developer" ) ;
String gamePublisherEu = resultSet . getString ( "Game_Developer" ) ;
String gamePublisherJp = resultSet . getString ( "Game_Console" ) ;
String gamePublisherNa = resultSet . getString ( "Game_Console" ) ;
String gameGenre = resultSet . getString ( "Game_Genre" ) ;
String gameReleaseEu = resultSet . getString ( "Game_Release_EU" ) ;
String gameReleaseEuDots = gameReleaseEu . substring ( 8 , 10 ) + "." + gameReleaseEu . substring ( 5 , 7 )
+ "." + gameReleaseEu . substring ( 0 , 4 ) ;
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseJpDots = gameReleaseJp . substring ( 8 , 10 ) + "." + gameReleaseJp . substring ( 5 , 7 )
+ "." + gameReleaseJp . substring ( 0 , 4 ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseNaDots = gameReleaseNa . substring ( 8 , 10 ) + "." + gameReleaseNa . substring ( 5 , 7 )
+ "." + gameReleaseNa . substring ( 0 , 4 ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
String gameReleaseAuDots ;
if ( gameReleaseAu ! = null ) {
gameReleaseAuDots = gameReleaseAu . substring ( 8 , 10 ) + "." + gameReleaseAu . substring ( 5 , 7 )
+ "." + gameReleaseAu . substring ( 0 , 4 ) ;
} else {
gameReleaseAuDots = "Unknown" ;
}
int gameUsk = resultSet . getInt ( "Game_USK_Rating" ) ;
int gamePegi = resultSet . getInt ( "Game_PEGI_Rating" ) ;
String gameEsrb = resultSet . getString ( "Game_ESRB_Rating" ) ;
String gameCero = resultSet . getString ( "Game_CERO_Rating" ) ;
String gameAcb = resultSet . getString ( "Game_ACB_Rating" ) ;
String gamePlayers = resultSet . getString ( "Game_Players" ) ;
if ( gamePegi ! = 0 ) {
result + = id + ": " + gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu + ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", " + gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", " + gameReleaseAuDots + ", " + gameUsk + ", " + gamePegi + ", " + gameEsrb + ", " + gameCero + ", " + gameAcb + ", " + gamePlayers + "\n" ;
} else {
result + = id + ": " + gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu + ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", " + gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", " + gameReleaseAuDots + ", " + gameUsk + ", Unknown, " + gameEsrb + ", " + gameCero + ", " + gameAcb + ", " + gamePlayers + "\n" ;
}
int id = resultSet . getInt ( "Game_ID" ) ;
String gameName = resultSet . getString ( "Game_Name" ) ;
String gameConsole = resultSet . getString ( "Game_Console" ) ;
String gameDeveloper = resultSet . getString ( "Game_Developer" ) ;
String gamePublisherEu = resultSet . getString ( "Game_Developer" ) ;
String gamePublisherJp = resultSet . getString ( "Game_Console" ) ;
String gamePublisherNa = resultSet . getString ( "Game_Console" ) ;
String gameGenre = resultSet . getString ( "Game_Genre" ) ;
String gameReleaseEu = resultSet . getString ( "Game_Release_EU" ) ;
String gameReleaseEuDots = gameReleaseEu . substring ( 8 , 10 ) + "." + gameReleaseEu . substring ( 5 , 7 ) + "."
+ gameReleaseEu . substring ( 0 , 4 ) ;
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseJpDots = gameReleaseJp . substring ( 8 , 10 ) + "." + gameReleaseJp . substring ( 5 , 7 ) + "."
+ gameReleaseJp . substring ( 0 , 4 ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseNaDots = gameReleaseNa . substring ( 8 , 10 ) + "." + gameReleaseNa . substring ( 5 , 7 ) + "."
+ gameReleaseNa . substring ( 0 , 4 ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
String gameReleaseAuDots ;
if ( gameReleaseAu ! = null ) {
gameReleaseAuDots = gameReleaseAu . substring ( 8 , 10 ) + "." + gameReleaseAu . substring ( 5 , 7 ) + "."
+ gameReleaseAu . substring ( 0 , 4 ) ;
} else {
gameReleaseAuDots = "Unknown" ;
}
int gameUsk = resultSet . getInt ( "Game_USK_Rating" ) ;
int gamePegi = resultSet . getInt ( "Game_PEGI_Rating" ) ;
String gameEsrb = resultSet . getString ( "Game_ESRB_Rating" ) ;
String gameCero = resultSet . getString ( "Game_CERO_Rating" ) ;
String gameAcb = resultSet . getString ( "Game_ACB_Rating" ) ;
String gamePlayers = resultSet . getString ( "Game_Players" ) ;
if ( gamePegi ! = 0 ) {
result + = id + ": " + gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu
+ ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", "
+ gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", "
+ gameReleaseAuDots + ", " + gameUsk + ", " + gamePegi + ", " + gameEsrb + ", " + gameCero
+ ", " + gameAcb + ", " + gamePlayers + "\n" ;
} else {
result + = id + ": " + gameName + ", " + gameConsole + ", " + gameDeveloper + ", " + gamePublisherEu
+ ", " + gamePublisherJp + ", " + gamePublisherNa + ", " + gameGenre + ", "
+ gameReleaseEuDots + ", " + gameReleaseJpDots + ", " + gameReleaseNaDots + ", "
+ gameReleaseAuDots + ", " + gameUsk + ", Unknown, " + gameEsrb + ", " + gameCero + ", "
+ gameAcb + ", " + gamePlayers + "\n" ;
}
}
}
statement . close ( ) ;
statement . close ( ) ;
@ -86,7 +93,7 @@ public class Games {
/ / The substring removes the last New line in the String .
/ / The substring removes the last New line in the String .
return result . substring ( 0 , result . length ( ) - 1 ) ;
return result . substring ( 0 , result . length ( ) - 1 ) ;
}
}
public String checkGames ( ) {
public String checkGames ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name FROM Games" ;
String query = "SELECT Game_Name FROM Games" ;
@ -1089,7 +1096,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkAllSameReleaseYear ( ) {
public String checkAllSameReleaseYear ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games" ;
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games" ;
@ -1106,13 +1113,16 @@ public class Games {
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
if ( gameReleaseAu = = null ) {
if ( gameReleaseAu = = null ) {
} else {
} else {
if ( gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) ) & & gameReleaseJp . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
& & gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) & & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseEu . substring ( 0 , 4 ) )
& & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) ) & & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) ) {
if ( gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) )
& & gameReleaseJp . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
& & gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
& & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseEu . substring ( 0 , 4 ) )
& & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) )
& & gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) ) {
result + = gameName + ", " ;
result + = gameName + ", " ;
}
}
}
}
@ -1127,7 +1137,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkAllDifferentReleaseYear ( ) {
public String checkAllDifferentReleaseYear ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games" ;
String query = "SELECT Game_Name, Game_Release_EU, Game_Release_JP, Game_Release_NA, Game_Release_AU FROM Games" ;
@ -1144,13 +1154,16 @@ public class Games {
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseJp = resultSet . getString ( "Game_Release_JP" ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseNa = resultSet . getString ( "Game_Release_NA" ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
String gameReleaseAu = resultSet . getString ( "Game_Release_AU" ) ;
if ( gameReleaseAu = = null ) {
if ( gameReleaseAu = = null ) {
result + = gameName + ", " ;
result + = gameName + ", " ;
} else {
} else {
if ( ! gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) ) | | ! gameReleaseJp . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
| | ! gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) | | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseEu . substring ( 0 , 4 ) )
| | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) ) | | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) ) {
if ( ! gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) )
| | ! gameReleaseJp . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
| | ! gameReleaseEu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) )
| | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseEu . substring ( 0 , 4 ) )
| | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseJp . substring ( 0 , 4 ) )
| | ! gameReleaseAu . substring ( 0 , 4 ) . equals ( gameReleaseNa . substring ( 0 , 4 ) ) ) {
result + = gameName + ", " ;
result + = gameName + ", " ;
}
}
}
}
@ -1165,7 +1178,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkOnePlayer ( ) {
public String checkOnePlayer ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
@ -1180,7 +1193,8 @@ public class Games {
String gameName = resultSet . getString ( "Game_Name" ) ;
String gameName = resultSet . getString ( "Game_Name" ) ;
String gamePlayers = resultSet . getString ( "Game_Players" ) ;
String gamePlayers = resultSet . getString ( "Game_Players" ) ;
if ( gamePlayers . equals ( "1" ) | | gamePlayers . equals ( "1-2" ) | | gamePlayers . equals ( "1-4" ) | | gamePlayers . equals ( "1-8" ) ) {
if ( gamePlayers . equals ( "1" ) | | gamePlayers . equals ( "1-2" ) | | gamePlayers . equals ( "1-4" )
| | gamePlayers . equals ( "1-8" ) ) {
result + = gameName + ", " ;
result + = gameName + ", " ;
}
}
@ -1194,7 +1208,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkTwoPlayer ( ) {
public String checkTwoPlayer ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
@ -1223,7 +1237,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkFourPlayer ( ) {
public String checkFourPlayer ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
@ -1252,7 +1266,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkEightPlayer ( ) {
public String checkEightPlayer ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
@ -1281,7 +1295,7 @@ public class Games {
return result . substring ( 0 , result . length ( ) - 2 ) ;
return result . substring ( 0 , result . length ( ) - 2 ) ;
}
}
public String checkOnePlayerOnly ( ) {
public String checkOnePlayerOnly ( ) {
String result = "" ;
String result = "" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;
String query = "SELECT Game_Name, Game_Players FROM Games" ;