info.informatica.report.data
Class JDBCDataSource

java.lang.Object
  extended by info.informatica.report.data.SimpleDataSource
      extended by info.informatica.report.data.JDBCDataSource
All Implemented Interfaces:
ReportDataSource

public class JDBCDataSource
extends SimpleDataSource

A JDBC-based DataSource implementation.

Author:
Carlos Amengual (amengual at informatica.info)

Constructor Summary
JDBCDataSource(Report rep)
           
 
Method Summary
 void close()
          Release all the resources associated to this data source
 void loadData(Connection con, DataDict dict, DataView form)
           
 void loadData(Connection con, DataDict dict, Map<String,? extends Object> data_values)
          Loads data into this ReportDataSource.
 void loadData(String queryname, ResultSet rs)
          Loads a single query resulset into this ReportDataSource.
 
Methods inherited from class info.informatica.report.data.SimpleDataSource
getData, getEnviron, putData, setEnviron
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JDBCDataSource

public JDBCDataSource(Report rep)
Parameters:
rep - the Report for which this ReportDataSource is intended.
Method Detail

loadData

public void loadData(String queryname,
                     ResultSet rs)
              throws DataException,
                     SQLException
Loads a single query resulset into this ReportDataSource.

This is useful as a "documentation method", or if you do not want to use the data dictionaries.

Parameters:
rs - the Resultset to be printed.
queryname - The name of the query in the report (ie. the datasource name).
Throws:
DataException
SQLException

loadData

public void loadData(Connection con,
                     DataDict dict,
                     Map<String,? extends Object> data_values)
              throws DataException,
                     SQLException
Loads data into this ReportDataSource.

Parameters:
con - Database connection.
dict - The data dictionary.
data_values - a field->value map used to set the parameters of the query statements that shall fill this ReportDataSource.
Throws:
DataException
SQLException

loadData

public void loadData(Connection con,
                     DataDict dict,
                     DataView form)
              throws DataException,
                     SQLException
Throws:
DataException
SQLException

close

public void close()
Description copied from interface: ReportDataSource
Release all the resources associated to this data source

Specified by:
close in interface ReportDataSource
Overrides:
close in class SimpleDataSource