ResultSet resultAttribute = attrStatement.executeQuery(request);
while(resultAttribute.next()) {
int db_id_attr = resultAttribute.getInt(1);
String db_name = resultAttribute.getString(2);
String db_value = resultAttribute.getString(3);
v.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value));
}
} catch(SQLException ex) {
VisualGraph.log.printException(ex);
} finally {
if(attrStatement != null) {
try {
attrStatement.close();
} catch(SQLException ex) {
VisualGraph.log.printException(ex);
}
}
}
}
} catch (SQLException ex) {
VisualGraph.log.printException(ex);
} finally {
if(vertexStatement != null) {
try {
vertexStatement.close();
} catch(SQLException ex) {
VisualGraph.log.printException(ex);
}
}
}
//edges--------------------------
ArrayList<StorableEdge>listEdge = new ArrayList<StorableEdge>();
Statement edgeStatement = null;
try {
edgeStatement = this.currConnection.createStatement();
request = "select s2.db_id, s2.id, s2.db_id_source, db_id_target " +
"from com_subgraph_edge s1, edge s2 " +
"where s1.db_id_subgraph = " + (new Integer(id_subgraph)).toString() + " and s2.db_id = s1.db_id_edge;";
ResultSet resultEdge = edgeStatement.executeQuery(request);
while(resultEdge.next()) {
int db_id_edge = resultEdge.getInt(1);
String id_edge = resultEdge.getString(2);
Integer db_id_source = (Integer)resultEdge.getObject(3);
Integer db_id_target = (Integer)resultEdge.getObject(4);
if(db_id_source != null && db_id_target != null) {
StorableVertex source = null, target = null;
for(StorableVertex bufVertex : listVertex) {
if(bufVertex.getStorableId() == db_id_source) {
source = bufVertex;
}
if(bufVertex.getStorableId() == db_id_target) {
target = bufVertex;
}
}
if(source != null && target != null) {
StorableEdge e = new StorableEdge(db_id_edge, source, target, id_edge);
listEdge.add(e);
//attributes-----------------
Statement attrStatement = null;
try {
attrStatement = this.currConnection.createStatement();
request = "select s2.db_id, s2.name, s2.value " +
"from com_edge_attribute s1, attribute s2 " +
"where s1.db_id_edge = " + (new Integer(db_id_edge)).toString() + " and s2.db_id = s1.db_id_attribute;";
ResultSet resultAttribute = attrStatement.executeQuery(request);
while(resultAttribute.next()) {
int db_id_attr = resultAttribute.getInt(1);
String db_name = resultAttribute.getString(2);
String db_value = resultAttribute.getString(3);
e.addStorableAttribute(new StorableAttribute(db_id_attr, db_name, db_value));
}
} catch (SQLException ex) {
VisualGraph.log.printException(ex);
} finally {
if(attrStatement != null) {