public Vector<Account> loadDB() throws SQLException, IOException
	{
		Vector<Account> result = new Vector<Account>();
		PreparedStatement statement;
		statement = bd.prepareStatement("SELECT * FROM accounts;");
		statement.execute();
		rs = statement.getResultSet();
		while (rs.next())
		{
			Account curAccount = new Account();
			curAccount.setLogin(rs.getString("login"));
			curAccount.setPassword(new String(rs.getBytes("password")));
			curAccount.setWins(rs.getInt("wins"));
			curAccount.setLoses(rs.getInt("loses"));
			curAccount.setSkill(rs.getInt("skill"));
			
			String tmp = rs.getString("name");
			if (!rs.wasNull())
			{
				curAccount.setName(tmp);
			}
			tmp = rs.getString("surname");
			if (!rs.wasNull())
			{
				curAccount.setSurname(tmp);
			}
			tmp = rs.getString("country");
			if (!rs.wasNull())
			{
				curAccount.setCountry(tmp);
			}
			Integer tmpInt = rs.getInt("age");
			if (!rs.wasNull())
			{
				curAccount.setAge(tmpInt);
			}
			
			byte[] ImgBytesArr = rs.getBytes("avatar");
			if (!rs.wasNull())
			{
				curAccount.setAvatar(ImgBytesArr);
				Integer type = rs.getInt("type");
				curAccount.setType(type);
			}
			else
			{
				BufferedImage img;
				img = ImageIO.read(new File("unknown_user.jpg"));
				ByteArrayOutputStream baos = new ByteArrayOutputStream();
				ImageIO.write(img, "jpg", baos);
				baos.flush();
				curAccount.setAvatar(baos.toByteArray());
				curAccount.setType(SQLConstants.NOTYPE);
			}
			
			tmpInt = rs.getInt("gender");
			if (!rs.wasNull())
				curAccount.setGender(tmpInt);
			else
				curAccount.setGender(SQLConstants.MALE);
			
			result.add(curAccount);
		}
		return result;
	}