日期:2014-05-17 浏览次数:20694 次
ArrayList<String> array= new ArrayList<String>(); String sql ="select (name,price,number)from xxx"; try { System.out.print(sql); stat=conn.createStatement(); rs=stat.executeQuery(sql); while(rs.next()){ array.add(new Goods(rs.getString("name"),rs.getInt("number"),rs.getDouble("price"))); } //我用有参是这样做的,如果没有有参构造,改怎么实现