private int exportSocialNetwork(Network network) {
    int nid = insertSocialNetwork(network);
    network.setNid(nid);

    for (Edge edge : network.getEdges()) {
      edge.setNid(nid);
      insertSocialEdge(edge);
    }

    return nid;
  }
  private void insertSocialEdge(Edge edge) {
    String query = "INSERT INTO s_edges (user_a, user_b, weight, nid) VALUES " + "(?, ?, ?, ?)";
    ISetter[] params = {
      new IntSetter(1, edge.getUser_a()),
      new IntSetter(2, edge.getUser_b()),
      new FloatSetter(3, edge.getWeight()),
      new IntSetter(4, edge.getNid())
    };

    PreparedStatementExecutionItem ei = new PreparedStatementExecutionItem(query, params);
    addExecutionItem(ei);
    ei.waitUntilExecuted();
  }