Package persistence
Class DBRecord
java.lang.Object
persistence.DBRecord
Implementation of DBRecord class for Database INSERT and SELECT queries.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DBRecord
Constructs a new record from String and int parameters.- Parameters:
p1Name
- name of Player1p2Name
- name of Player2winner
- the winner's numbertime
- the game's length in seconds
-
DBRecord
Constructs a new record from a ResultSet.- Parameters:
resultSet
- the ResultSet to convert
-
-
Method Details
-
getP1Name
Returns the name of Player1.- Returns:
- the name of Player1
-
getP2Name
Returns the name of Player2.- Returns:
- the name of Player2
-
getWinner
public int getWinner()Returns the winner's number or 0 for draw.- Returns:
- the winner's number or 0 for draw
-
getTime
public int getTime()Returns the game's length in seconds.- Returns:
- the game's length in seconds
-
toString
Returns the inner state of the record as a String.
-