protected int size(TableDescNodes desc) {
return size(desc.getTableName());
}
protected int size(String name) {
ResultSetJDBC result = null ;
try {
int size = -1;
result = store.getConnection().execQuery("SELECT COUNT(*) FROM " + name);
if (result.get().next())
size = result.get().getInt(1);
result.close();
result = store.getConnection().execQuery("SELECT * FROM " + name);
while (result.get().next())
System.err.println("Row: " + result.get().getObject(1));
return size;
} catch (SQLException e) {
throw new RuntimeException("Can't get size of table '" + name + "'", e);
}
finally { RS.close(result) ; }