Elite Diviner
- Joined
- Jul 13, 2008
- Messages
- 419
- Reaction score
- 217
In all packets where birthday is used it's sent to the server as Integer, so why not reading it like that from database instead of parsing it as Calendar?
Nothing special, should be clear what to do.
Code:
private int birthday;
Code:
try {
PreparedStatement ps = con.prepareStatement("SELECT `id`, `password`, `birthday` + 0 AS `bday` FROM `accounts` WHERE `name` = ?");
ps.setString(1, name);
ResultSet rs = ps.executeQuery();
if (rs.next()) {
id = rs.getInt("id");
birthday = rs.getInt("bday");
...
Code:
public boolean validateBirthday(int birthday) {
return birthday == this.birthday;
}
Nothing special, should be clear what to do.
Last edited: