public class Statistics
extends java.lang.Object
| Constructor | Description |
|---|---|
Statistics() |
| Modifier and Type | Method | Description |
|---|---|---|
void |
connect() |
Connects to the statistics server.
|
void |
createPlayer(java.lang.String nick) |
Creates new player in the database.
|
void |
disconnect() |
Disconnects.
|
void |
exchangeStats(PlayerStats stats) |
Exchanges data with the statistics server.
|
PlayerStats |
getStats(java.lang.String nick) |
Retrieves player's stats from the server.
|
boolean |
playerInDatabase(java.lang.String nick) |
Checks if player is in the database.
|
public void connect()
throws java.sql.SQLException
java.sql.SQLException - when connection was not possible.public void disconnect()
public boolean playerInDatabase(java.lang.String nick)
throws java.sql.SQLException
nick - player's name.java.sql.SQLException - when connection was not possible or another database error occured.public void createPlayer(java.lang.String nick)
throws java.sql.SQLException
nick - player's name.java.sql.SQLException - when connection was not possible, player is already in the database or another database error occured.public PlayerStats getStats(java.lang.String nick) throws java.sql.SQLException
nick - player's name.java.sql.SQLException - when connection was not possible or another database error occured.public void exchangeStats(PlayerStats stats) throws java.sql.SQLException
stats - player stats to be compared with these in the database.java.sql.SQLException - when connection was not possible or another database error occured.