jdbreport.source
Class JdbcDataSet

java.lang.Object
  extended by jdbreport.source.AbstractDataSet
      extended by jdbreport.source.JdbcDataSet
All Implemented Interfaces:
Cloneable, ReportDataSet

public class JdbcDataSet
extends AbstractDataSet

Version:
2.0 07.02.2011
Author:
Andrey Kholmanskih

Field Summary
 
Fields inherited from class jdbreport.source.AbstractDataSet
logger
 
Constructor Summary
JdbcDataSet()
           
JdbcDataSet(String id)
           
 
Method Summary
 void close()
           
 Collection<String> getColumnNames()
          Returns names' collection of columns or properties
 Object getCurrentObject()
          Returns a current object, can be null
 String getId()
           
 String getMasterId()
          Returns id of the leading DataSet
 and.dbcomp.DataSetParams getParams()
          Returns parameters
 String getQuery()
           
 and.dbcomp.DbSource getSource()
           
 Object getValue(int index)
           
 Object getValue(String name)
          Returns value from the current record (object) by the name
 boolean hasNext()
           
 boolean isEof()
           
 boolean next()
          Moves the cursor on the next record (object) in the DataSet
 void open()
           
 boolean reopen()
          Reopens the DataSet when the MasterDataSet changes parameters
 void setId(String id)
           
 void setMasterId(String masterId)
           
 void setQuery(String query)
           
 void setSource(and.dbcomp.DbSource source)
           
 void setVars(Map<Object,Object> vars)
           
 
Methods inherited from class jdbreport.source.AbstractDataSet
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JdbcDataSet

public JdbcDataSet()

JdbcDataSet

public JdbcDataSet(String id)
Method Detail

setVars

public void setVars(Map<Object,Object> vars)

next

public boolean next()
             throws ReportException
Description copied from interface: ReportDataSet
Moves the cursor on the next record (object) in the DataSet

Specified by:
next in interface ReportDataSet
Overrides:
next in class AbstractDataSet
Returns:
true if successful
Throws:
ReportException

isEof

public boolean isEof()

getValue

public Object getValue(int index)
                throws ReportException
Throws:
ReportException

getId

public String getId()
Specified by:
getId in interface ReportDataSet
Overrides:
getId in class AbstractDataSet
Returns:
DataSet id

setId

public void setId(String id)

setQuery

public void setQuery(String query)
Parameters:
query - The query to set.

getQuery

public String getQuery()
Returns:
the query

getSource

public and.dbcomp.DbSource getSource()

setSource

public void setSource(and.dbcomp.DbSource source)

open

public void open()
          throws ReportException
Throws:
ReportException

reopen

public boolean reopen()
               throws ReportException
Description copied from interface: ReportDataSet
Reopens the DataSet when the MasterDataSet changes parameters

Returns:
true if not eof
Throws:
ReportException

close

public void close()

getMasterId

public String getMasterId()
Description copied from interface: ReportDataSet
Returns id of the leading DataSet

Specified by:
getMasterId in interface ReportDataSet
Overrides:
getMasterId in class AbstractDataSet
Returns:
masterId property

setMasterId

public void setMasterId(String masterId)

getValue

public Object getValue(String name)
                throws ReportException
Description copied from interface: ReportDataSet
Returns value from the current record (object) by the name

Parameters:
name - - the column's name or the property's name
Returns:
value by the name
Throws:
ReportException

getColumnNames

public Collection<String> getColumnNames()
                                  throws ReportException
Description copied from interface: ReportDataSet
Returns names' collection of columns or properties

Returns:
names of columns or properties
Throws:
ReportException

getParams

public and.dbcomp.DataSetParams getParams()
                                   throws ReportException
Description copied from interface: ReportDataSet
Returns parameters

Specified by:
getParams in interface ReportDataSet
Overrides:
getParams in class AbstractDataSet
Returns:
parameters
Throws:
ReportException

getCurrentObject

public Object getCurrentObject()
Description copied from interface: ReportDataSet
Returns a current object, can be null

Returns:
- current object

hasNext

public boolean hasNext()