com.crystaldecisions.reports.sdk
Class DatabaseController

java.lang.Object
  |
  +--com.crystaldecisions.reports.sdk.DatabaseController

public class DatabaseController
extends java.lang.Object

A database controller which provides an interface for some database related operations.


Method Summary
 IDatabase getDatabase()
          Returns an IDatabase object which holds information like tables in the report.
 void logon(java.lang.String sUser, java.lang.String sPassword)
           Sets all of the tables in the report with a specified user name and password.
 void setDataSource(java.util.Collection domainData, java.lang.Class domainClass, java.lang.String oldTableAlias, java.lang.String newTableName)
          Sets a given collection into an existing datasource.
 void setDataSource(java.sql.ResultSet data, java.lang.String oldTableAlias, java.lang.String newTableName)
          Sets a given database result set into an existing datasource.
 void setTableLocation(ITable curTable, ITable newTable)
          Changes table location of curTable to a new table.
 void setTableLocationEx(java.lang.Object curTable, java.lang.Object newObject)
          Sets table location specified by curTable.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getDatabase

public IDatabase getDatabase()
Returns an IDatabase object which holds information like tables in the report.

Returns:
an IDatabase object

setTableLocation

public void setTableLocation(ITable curTable,
                             ITable newTable)
                      throws ReportSDKException
Changes table location of curTable to a new table.

Parameters:
curTable - an ITable representing an existing table in the report
newTable - an ITable representing the new table to change to
Throws:
ReportSDKException - if set location failed for any reason

setTableLocationEx

public void setTableLocationEx(java.lang.Object curTable,
                               java.lang.Object newObject)
                        throws ReportSDKException
Sets table location specified by curTable.

Parameters:
curTable - One of the following:
1. An Integer object representing the table index
2. An ITable object
3. A String specifying the table alias name

newObject - One of the following:
1. An IConnectionInfo object
2. An ITable object
Throws:
ReportSDKException

setDataSource

public void setDataSource(java.sql.ResultSet data,
                          java.lang.String oldTableAlias,
                          java.lang.String newTableName)
                   throws ReportSDKException
Sets a given database result set into an existing datasource.

Parameters:
data - a java.sql.ResultSet object
oldTableAlias - name of an existing table to replace
newTableName - name of the table after replacement
Throws:
ReportSDKException

setDataSource

public void setDataSource(java.util.Collection domainData,
                          java.lang.Class domainClass,
                          java.lang.String oldTableAlias,
                          java.lang.String newTableName)
                   throws ReportSDKException
Sets a given collection into an existing datasource.

Parameters:
domainData -
domainClass -
oldTableAlias - name of an existing table to replace
newTableName - name of the table after replacement
Throws:
ReportSDKException

logon

public void logon(java.lang.String sUser,
                  java.lang.String sPassword)
           throws com.crystaldecisions.sdk.occa.report.lib.ReportSDKException

Sets all of the tables in the report with a specified user name and password. This is a helper function that applies logon information to all of the database connections used in the report; use this method instead of setting the ConnectionInfo for each.

Parameters:
sUser - The user name.
sPassword - The password.
Throws:
ReportSDKException