public void set(double balance) {
    AccountSetEvent Event = new AccountSetEvent(this.name, balance);
    iConomy.getBukkitServer().getPluginManager().callEvent(Event);

    Connection conn = null;
    PreparedStatement ps = null;
    try
    {
      conn = iConomy.getiCoDatabase().getConnection();

      if (this.bankId == 0) {
        ps = conn.prepareStatement("UPDATE " + Constants.SQLTable + " SET balance = ? WHERE username = ?");
        ps.setDouble(1, balance);
        ps.setString(2, this.name);
      } else {
        ps = conn.prepareStatement("UPDATE " + Constants.SQLTable + "_BankRelations SET holdings = ? WHERE account_name = ? AND bank_id = ?");
        ps.setDouble(1, balance);
        ps.setString(2, this.name);
        ps.setInt(3, this.bankId);
      }

      ps.executeUpdate();
    } catch (Exception ex) {
      System.out.println("[iConomy] Failed to set holdings: " + ex);
    } finally {
      if (ps != null) try {
          ps.close();
        } catch (SQLException ex) {
        } if (conn != null) try {
          conn.close(); } catch (SQLException ex) {
        } 
    }
  }