日期:2014-05-18 浏览次数:20652 次
public Map doFeedbackSql(String sql,String[] objid)throws DAOException{
ResultSet rs=null;
Map map=null;
ps = this.getWrappedConnection().prepareStatement(sql);
rs = ps.executeQuery();
while(rs.next()){
System.out.println(rs.getString(objid[0])+"__"+rs.getString(objid[0]));
map.put(objid[0], rs.getString(objid[0]));
map.put(objid[1], rs.getString(objid[1]));
}
return map;
}
String sql="Select * from tb_testfeedback where id='1'";
String[] objid={"id","name"};
Map map=dao.doFeedbackSql(sql, objid);
java.lang.NullPointerException
at com.regaltec.rsas.metadata.feedback.dao.FeedbackMetadataDAO.doFeedbackSql(FeedbackMetadataDAO.java:280)
at com.regaltec.rsas.metadata.feedback.dao.FeedbackMetadataDAO.main(FeedbackMetadataDAO.java:316)
明显的是你map为null,前面声明map时Map map = new HashMap();