public static SmartObject[] getObjects(String classname)
        throws SmartObjectException {
  try {
    Vector smartObjects = new Vector();
    Class theClass = Class.forName(classname);
    SmartObject so = newObject(theClass);
    String query = "SELECT id FROM " + so.getTableName();
    Connection con = ds.getConnection();
    Statement s = con.createStatement();
    s.executeQuery(query);
    ResultSet rs = s.getResultSet();
    while (rs.next()) {
      smartObjects.add(getObject(classname, rs.getInt("id")));
    }
    closeAll(rs, s, con);
    return (SmartObject[]) smartObjects.toArray(new SmartObject[0]);
  }
  catch (ClassNotFoundException cnfe) {
    throw new SmartObjectException("The " + classname + " class could not be loaded.", cnfe);
  }
  catch (SQLException sqle) {
    throw new SmartObjectException("Exception geting object IDs for " + classname + ".", sqle);
  }
}
