1 23 24 package org.dbforms.servlets.reports; 25 26 import net.sf.jasperreports.engine.JRException; 27 28 import org.apache.commons.logging.Log; 29 import org.apache.commons.logging.LogFactory; 30 31 import org.dbforms.config.ResultSetVector; 32 import java.util.Map ; 33 34 37 public final class JRDataSourceRSV extends JRDataSourceAbstract { 38 private static Log logCat = LogFactory.getLog(JRDataSourceRSV.class 39 .getName()); 40 41 private ResultSetVector rsv; 42 50 public JRDataSourceRSV(Map attributes, ResultSetVector rsv) { 51 super(attributes); 52 this.rsv = rsv; 53 this.rsv.moveFirst(); 54 this.rsv.movePrevious(); 57 } 58 59 62 public boolean next() throws JRException { 63 if (ResultSetVector.isNull(rsv)) { 64 return false; 65 } 66 if (rsv.isLast()) { 67 return false; 68 } 69 rsv.moveNext(); 70 return true; 71 } 72 73 public Object getFieldValue(String fieldName) { 74 Object o = null; 75 try { 76 o = rsv.getFieldAsObject(fieldName); 77 } catch (Exception e) { 78 logCat.error("getFieldValue", e); 79 } 80 return o; 81 } 82 83 } 84 | Popular Tags |