}
public void create(String layout, Iterator<DataGraph> iterator) throws DBException, UnknownHostException, DAOCreationException {
PreparedStatement statement;
DataGraph graph;
DataGraphDAO graphDAO;
try {
statement = connection.prepareStatement(CREATE);
statement.setString(1, layout);
statement.executeUpdate();
graphDAO = DAOFactory.getDataGraphDAO();
while ( iterator.hasNext() ) {
graph = iterator.next();
logger.info("Graph: " + graph.getContext().getData().getTitle());
if ( graph.getContext().getData().isCollector() ) {
logger.info(" (a collector)");
//collector = graph.getContext().getData().getCollector();
//graph.getContext().getData().getCollector().store(layout);
//graph.store(layout);
graphDAO.createGraph(layout, graph);
} else
logger.info(" (not a collector)");
}
} catch (SQLException e) {
logger.error("Problem creating layout " + layout + " in database");