private static int getTeamId(Statement statement, String teamName) throws SQLException {
    int id = -1;
    ResultSet resultSet = statement.executeQuery("select id from " + Settings.DB_TABLE_TEAM + " where name like '"
        + teamName + "' limit 1"); // SQL injection ?
    if (resultSet.next()) {
      id = resultSet.getInt(1);
    }
    else {
      statement.executeUpdate("insert into " + Settings.DB_TABLE_TEAM + " (name) values ('" + teamName + "')");
      //Now there is a field
      resultSet = statement.executeQuery("select id from " + Settings.DB_TABLE_TEAM + " where name like '"
          + teamName + "'"); // SQL injection ?
      if (resultSet.next())
        id = resultSet.getInt(1);
    }
    return id;
  }