rendered paste bodyprotected void getVotes(L2PcInstance activeChar)
{
int votes = 0;
Connection con = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
final PreparedStatement statement = con.prepareStatement("SELECT vote_points FROM accounts WHERE login=?");
statement.setString(1, activeChar.getAccountName());
final ResultSet rset = statement.executeQuery();
if (rset.next())
votes = rset.getInt("vote_points");
rset.close();
statement.close();
activeChar.sendMessage("You have actually "+ votes +" vote points.");
}
catch (final Exception e)
{
e.printStackTrace();
}
finally
{
L2DatabaseFactory.close(con);
}
}