public List<Familier> GetFamilier(){
List<Familier> lstFamiliers = new ArrayList<Familier>();
PreparedStatement ps = null;
Connection conn = null;
ResultSet rs = null;
String str="Select UserName,Password from User";
try{
conn = getConn();
ps = conn.prepareStatement(str);
rs = ps.executeQuery();
while (rs.next()) {
Familier fam = new Familier(rs.getString(1), rs.getString(2));
lstFamiliers.add(fam);
}
}catch(Exception e ){
e.printStackTrace();
}finally{
CloseAll(conn,ps,rs);
}return 1stFamiliers;
}
List<Familier> lstFamiliers = new ArrayList<Familier>();
PreparedStatement ps = null;
Connection conn = null;
ResultSet rs = null;
String str="Select UserName,Password from User";
try{
conn = getConn();
ps = conn.prepareStatement(str);
rs = ps.executeQuery();
while (rs.next()) {
Familier fam = new Familier(rs.getString(1), rs.getString(2));
lstFamiliers.add(fam);
}
}catch(Exception e ){
e.printStackTrace();
}finally{
CloseAll(conn,ps,rs);
}return 1stFamiliers;
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货