|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface SQLDataProvider
Warning: This interface is no longer functional from the SAP BusinessObjects 4.0 release onwards.
TheSQLDataProvider interface is a specialized
DataProvider which supports the SQL query language.
DataProvider,
SQLContainer,
SQLNode,
SQLSelectStatement,
SamplingMode| Method Summary | |
|---|---|
boolean |
changeSQL()
Replaces the previous SQL statement in the document with the new validated SQL Statement. |
boolean |
getDuplicatedRows()
Returns true when identical rows in the database will be
retrieved as often as they appear when a Query is
executed. |
SamplingMode |
getSamplingMode()
Gets database sampling method. |
int |
getSamplingSize()
Returns number of row retrieved by database sampling. |
SQLContainer |
getSQLContainer()
Returns the root SQLContainer for this
SQLDataProvider. |
SQLContainer |
getSQLContainer(boolean resolvedSQL)
This methods allows to retrieve an unresolved SQL. |
boolean |
isCustomSQL()
Returns true if this SQLDataProvider
contains SQL customized by the Web Intelligence user. |
void |
resetSQL()
Changes the current SQL to the query generated SQL. |
void |
setDuplicatedRows(boolean allow)
Set to true for identical rows to be retrieved as often as
they appear in the database. |
void |
setSamplingMode(SamplingMode mode)
Changes database supporting sampling mode to retrive rows SQLDataProvider.setSamplingSize(int) from database. |
void |
setSamplingSize(int size)
Sets the number of rows retrieved by database sampling. |
boolean |
validateSQL()
Validates the SQL and returns true if the new SQL
statement is valid. |
| Methods inherited from interface com.businessobjects.rebean.wi.DataProvider |
|---|
cancelQuery, clearContexts, copyCombinedQueries, executeQuery, generateQuery, getCombinedQueries, getDataSource, getDataSourceParameterValues, getDate, getDependents, getDuration, getFlowCount, getID, getName, getPromptOrder, getQuery, getQueryNode, getResult, getResultAsCSV, getResultAsXML, getResultAsXML, getResultExpressions, getRowCount, getSource, getSourceName, getSources, hasCombinedQueries, isIgnoredForRefresh, isPartialResult, isQuerySubmitted, isSampledData, isSupported, purge, purge, removeCombinedQueries, runQuery, setName |
| Method Detail |
|---|
SQLContainer getSQLContainer()
SQLContainer for this
SQLDataProvider.
SQLContainer.
UnsupportedFeatureException - if DataProviderFeature.VIEW_SQL isn't granted.SQLContainer getSQLContainer(boolean resolvedSQL)
resolvedSQL - if true, it behaves as
SQLDataProvider.getSQLContainer(). If false, it
retrieves the unresolved SQL.
SQLContainer.
UnsupportedFeatureException - if DataProviderFeature.VIEW_SQL isn't granted.boolean isCustomSQL()
true if this SQLDataProvider
contains SQL customized by the Web Intelligence user.
false when the SQL contained in this
instance has been generated by Web Intelligence,
true when a user has customized the SQL and saved
the document.
boolean validateSQL()
throws REException
true if the new SQL
statement is valid.
This method returns false if the SQL contains at least one
LOV prompt or nested prompt that is not filled. If this is the case,
before calling validateSQL,
DocumentInstance.getMustFillPrompts() must return
false, that is to say, all prompts have been filled.
Example: The following example shows how to validate the SQL for
a SQLDataProvider containing prompts.
//dp is an instance of SQLDataProvider.
boolean bValidate = dp.validateSQL();
if (bValidate == false) {
Prompts prompts = getDocument().getPrompts();
for (int i = 0; i < prompts.getCount(); i++) {
Prompt prompt = prompts.getItem(i);
String val = ((prompt.getDefaultValues() != null && prompt
.getDefaultValues().length > 0) ? prompt.getDefaultValues()[0]
: "France");
prompt.enterValues(new String[] { val });
}
getDocument().setPrompts();
if (!getDocument().getMustFillPrompts()) {
dp.changeSQL();
}
}
Note: Only FROM and WHERE clauses are modifiable if the user has sufficient rights. The SELECT clause is not customizable.
true when the customized SQL is valid.
REException - If all prompts are filled and the SQL is invalid.
UnsupportedFeatureException - if DataProviderFeature#EDIT_SQL isn't granted.SQLSelectStatement.setSQL(String)
boolean changeSQL()
throws REException
Note: Business Objects recommends that customized SQL is
validated using SQLDataProvider.validateSQL() before saving the
new SQL statement by calling SQLDataProvider.changeSQL().
true if the SQL has been replaced.
UnsupportedFeatureException - if DataProviderFeature#EDIT_SQL isn't granted.
REException - When an error occured.SQLDataProvider.validateSQL(),
SQLSelectStatement.setSQL(String)boolean getDuplicatedRows()
true when identical rows in the database will be
retrieved as often as they appear when a Query is
executed.
true when identical rows will be retrieved
as often as they appear in the database, or false
when identical rows will be retrieved only once.void setDuplicatedRows(boolean allow)
true for identical rows to be retrieved as often as
they appear in the database.
allow - Set to true for identical rows to be retrieved
as often as they appear, false for identical
rows to be retrieved once only.
UnsupportedFeatureException - if DataProviderFeature.DUPLICATE_ROW isn't supported
by server but value of allow is
true.void resetSQL()
ServerException - When an error occurred.SamplingMode getSamplingMode()
SamplingMode instance.void setSamplingMode(SamplingMode mode)
SQLDataProvider.setSamplingSize(int) from database.
If mode is SamplingMode.FREE_RANDOM or
SamplingMode.REPEATABLE_RANDOM, retrive rows will be
managed by database sampling.
If fetchMode is SamplingMode.NONE, there
is no database sampling and sampling size SQLDataProvider.getSamplingSize() will
be 0.
The database sampling is allowed only if QueryContainer contains one simple Query.
mode - The value of SamplingMode instance.
java.lang.NullPointerException - if mode is null.
QueryException - while set SamplingMode.FREE_RANDOM or
SamplingMode.REPEATABLE_RANDOM but
QueryContainer contains more than one query.SamplingModeint getSamplingSize()
If SQLDataProvider.getSamplingMode() returns SamplingMode.NONE,
this call returns -1.
SamplingModevoid setSamplingSize(int size)
size - the number of row should be retrieved by database sampling.SamplingMode
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||