s.executeUpdate("DROP TABLE IF EXISTS BLOCKS;");
s.executeUpdate("CREATE TABLE BLOCKS (id, polygon, lots);");
PreparedStatement p = con.prepareStatement("INSERT INTO BLOCKS VALUES (?, ?, ?);");
for(int i=0; i<c.bm.blocks.size(); i++){
CityBlock b = c.bm.blocks.get(i);
p.setInt(1, i);
p.setString(2, b.shape.toString());
p.setString(3, b.lots.toString());
p.addBatch();
}
p.executeBatch();
}
//lots
{
s.executeUpdate("DROP TABLE IF EXISTS LOTS;");
s.executeUpdate("CREATE TABLE LOTS (blockid, polygon, buildingpolygon, buildingheight);");
PreparedStatement p = con.prepareStatement("INSERT INTO LOTS VALUES (?, ?, ?, ?);");
for(int i=0; i<c.bm.blocks.size(); i++){
CityBlock b = c.bm.blocks.get(i);
for(int j=0; j<b.lots.size(); j++){
Lot l = b.lots.get(j);
p.setInt(1, i);
p.setString(2, l.shape.toString());