首页上一页 1  下一页尾页 2 条记录 1/1页
        <> 第一章 数据库代码 请教问题 
                 	
                        发表在Java图书答疑
                        2009-02-04                                                
                    		
                                                                            	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    
                                           我看不懂下面的方法   不知道它实现作用  希望能给我逐行的细致讲解下   感激不尽
public static List findForList(String sql) {
List<List> list = new ArrayList<List>();
ResultSet rs = findForResultSet(sql);
try {
ResultSetMetaData metaData = rs.getMetaData();
int colCount = metaData.getColumnCount();
while (rs.next()) {
List<String> row = new ArrayList<String>();
for (int i = 1; i <= colCount; i++) {
String str = rs.getString(i);
if (str != null && !str.isEmpty())
str = str.trim();
row.add(str);
}
list.add(row);
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}
                
        	
        
        
    public static List findForList(String sql) {
List<List> list = new ArrayList<List>();
ResultSet rs = findForResultSet(sql);
try {
ResultSetMetaData metaData = rs.getMetaData();
int colCount = metaData.getColumnCount();
while (rs.next()) {
List<String> row = new ArrayList<String>();
for (int i = 1; i <= colCount; i++) {
String str = rs.getString(i);
if (str != null && !str.isEmpty())
str = str.trim();
row.add(str);
}
list.add(row);
}
} catch (Exception e) {
e.printStackTrace();
}
return list;
}

 
	
                                                 VIP会员
VIP会员 购物车
购物车

 私信
                         私信 
                     发表新帖
发表新帖 立即签到
立即签到 
        		  
        		 
         		 关注
关注
                  回复
 回复 支持(
                	支持( 反对(
                    反对( 
                







 
                     
                     
					 
						 
						 
						 
						