1.用vector:
【程序编程相关:编程必备经典:Java常见问题集锦(3)】 【推荐阅读:在java中找到需要的资源文件路径】/** 【扩展信息:编程必备经典:Java常见问题集锦(2)】 > * finds all ejbeans with a balance greater than a given amount. > * returns an enumeration of found ejbean primary keys. > * > * @param balancegreaterthan double test amount > * @return enumeration ejbean primary keys > * @exception javax.ejb.ejbexception > * if there is a communications or systems failure > */ > public enumeration ejbfindbigaccounts(double balancegreaterthan) { > log("ejbfindbigaccounts (balance > " + balancegreaterthan + ")"); > connection con = null; > preparedstatement ps = null; > > try { > con = getconnection(); > ps = con.preparestatement("select id from ejbaccounts where bal > ?"); > ps.setdouble(1, balancegreaterthan); > ps.executequery(); > resultset rs = ps.getresultset(); > vector v = new vector(); > string pk; > while (rs > return v.elements(); ... 下一页