public int getId() {
    Connection conn = null;
    ResultSet rs = null;
    PreparedStatement ps = null;
    int id = -1;
    try
    {
      conn = iConomy.getiCoDatabase().getConnection();
      ps = conn.prepareStatement("SELECT * FROM " + Constants.SQLTable + " WHERE username = ? LIMIT 1");
      ps.setString(1, this.name);
      rs = ps.executeQuery();

      if (rs.next())
        id = rs.getInt("id");
    }
    catch (Exception ex) {
      id = -1;
    } finally {
      if (ps != null) try {
          ps.close();
        } catch (SQLException ex) {
        } if (rs != null) try {
          rs.close();
        } catch (SQLException ex) {
        } if (conn != null) try {
          conn.close();
        } catch (SQLException ex) {
        } 
    }
    return id;
  }