{
if(Integer.parseInt(level) > 100)
{
level = "100";
}
ThreadConnection con = null;
FiltredPreparedStatement statement = null;
ResultSet rset = null;
try
{
con = L2DatabaseFactory.getInstance().getConnection();
// Check Account Exist
statement = con.prepareStatement("SELECT COUNT(*) FROM accounts WHERE login=?;");
statement.setString(1, account);
rset = statement.executeQuery();
if(rset.next() && rset.getInt(1) > 0)
{
// Exist
// Update
statement = con.prepareStatement("UPDATE accounts SET access_level=? WHERE login=?;");
statement.setEscapeProcessing(true);
statement.setString(1, level);
statement.setString(2, account);
statement.executeUpdate();
System.out.println("Account \"" + account + "\" Updated\n");