org.eclipse.birt.data.oda.impl
Class SimpleQuery

java.lang.Object
  extended byorg.eclipse.birt.data.oda.impl.SimpleQuery
All Implemented Interfaces:
IQuery

Deprecated. As of BIRT 2.0, replaced by org.eclipse.datatools.connectivity.oda.impl.SimpleQuery .
The BIRT ODA run-time framework has been migrated to the Eclipse Data Tools Platform (DTP) project.

public class SimpleQuery
extends java.lang.Object
implements IQuery

Default implementation of IQuery for a simple ODA runtime driver.


Constructor Summary
SimpleQuery()
          Deprecated.  
 
Method Summary
 void clearInParameters()
          Deprecated. An optional method to clear the current input parameter values immediately.
 void close()
          Deprecated. Attempts to close this IQuery.
 IResultSet executeQuery()
          Deprecated. Executes the statement's prepared query and returns a single IResultSet object.
 int findInParameter(java.lang.String parameterName)
          Deprecated. Returns the 1-based index of the specified input parameter.
 int getMaxRows()
          Deprecated. Returns the maximum number of rows that can be fetched from the statement's result set(s).
 IResultSetMetaData getMetaData()
          Deprecated. Returns the metadata of the current result set for this prepared IQuery.
 IParameterMetaData getParameterMetaData()
          Deprecated. Returns the count, data types, and other metadata attributes of the parameters defined in this prepared IQuery object.
 SortSpec getSortSpec()
          Deprecated. Returns the sort specification associated with this IQuery.
 void prepare(java.lang.String queryText)
          Deprecated. Performs necessary checks to determine whether the query text is of a valid format supported by this IQuery implementation.
 void setBigDecimal(int parameterId, java.math.BigDecimal value)
          Deprecated. Sets the designated parameter to the given decimal value.
 void setBigDecimal(java.lang.String parameterName, java.math.BigDecimal value)
          Deprecated. Sets the designated parameter to the given decimal value.
 void setDate(int parameterId, java.sql.Date value)
          Deprecated. Sets the designated parameter to the given Date value.
 void setDate(java.lang.String parameterName, java.sql.Date value)
          Deprecated. Sets the designated parameter to the given Date value.
 void setDouble(int parameterId, double value)
          Deprecated. Sets the designated parameter to the given double value.
 void setDouble(java.lang.String parameterName, double value)
          Deprecated. Sets the designated parameter to the given double value.
 void setInt(int parameterId, int value)
          Deprecated. Sets the designated parameter to the given integer value.
 void setInt(java.lang.String parameterName, int value)
          Deprecated. Sets the designated parameter to the given integer value.
 void setMaxRows(int max)
          Deprecated. Specifies the maximum number of rows that can be fetched from the statement's result set(s).
 void setProperty(java.lang.String name, java.lang.String value)
          Deprecated. Sets the named property with the specified value.
 void setSortSpec(SortSpec sortBy)
          Deprecated. Specifies the sort specification for this IQuery.
 void setString(int parameterId, java.lang.String value)
          Deprecated. Sets the designated parameter to the given string value.
 void setString(java.lang.String parameterName, java.lang.String value)
          Deprecated. Sets the designated parameter to the given string value.
 void setTime(int parameterId, java.sql.Time value)
          Deprecated. Sets the designated parameter to the given Time value.
 void setTime(java.lang.String parameterName, java.sql.Time value)
          Deprecated. Sets the designated parameter to the given Time value.
 void setTimestamp(int parameterId, java.sql.Timestamp value)
          Deprecated. Sets the designated parameter to the given Timestamp value.
 void setTimestamp(java.lang.String parameterName, java.sql.Timestamp value)
          Deprecated. Sets the designated parameter to the given Timestamp value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleQuery

public SimpleQuery()
Deprecated. 
Method Detail

prepare

public void prepare(java.lang.String queryText)
             throws OdaException
Deprecated. 
Description copied from interface: IQuery
Performs necessary checks to determine whether the query text is of a valid format supported by this IQuery implementation.

Specified by:
prepare in interface IQuery
Parameters:
queryText - a query text to prepare or pre-compile; it cannot be null.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.prepare(java.lang.String)

close

public void close()
           throws OdaException
Deprecated. 
Description copied from interface: IQuery
Attempts to close this IQuery.

Specified by:
close in interface IQuery
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.close()

getMetaData

public IResultSetMetaData getMetaData()
                               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Returns the metadata of the current result set for this prepared IQuery. This should only be called after prepare(). If the method is called before the IQuery is executed, the returned metadata refers to its first result set.

Specified by:
getMetaData in interface IQuery
Returns:
an IResultSetMetaData object.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.getMetaData()

executeQuery

public IResultSet executeQuery()
                        throws OdaException
Deprecated. 
Description copied from interface: IQuery
Executes the statement's prepared query and returns a single IResultSet object. Note: This should only be called after prepare().

Specified by:
executeQuery in interface IQuery
Returns:
an IResultSet object.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.executeQuery()

setProperty

public void setProperty(java.lang.String name,
                        java.lang.String value)
                 throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the named property with the specified value. Multiple calls using the same property name may be allowed to assign multiple values to the same property. Its handling is specific to individual driver implementation.
Each ODA extension property defined for a data set triggers an ODA consumer to call this method with corresponding property value, which could be null. An ODA consumer does not distinguish whether a property value is not set or explicitly set to null. Its handling is specific to individual driver implementation.
Note: This method should be called before execute() or executeQuery().
An optional method.

Specified by:
setProperty in interface IQuery
Parameters:
name - name of the property.
value - value to assign to the named property; could be null.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setProperty(java.lang.String, java.lang.String)

setMaxRows

public void setMaxRows(int max)
                throws OdaException
Deprecated. 
Description copied from interface: IQuery
Specifies the maximum number of rows that can be fetched from the statement's result set(s).
An optional method.

Specified by:
setMaxRows in interface IQuery
Parameters:
max - the maximum number of rows that can be fetched from each result set of this IQuery; zero means there is no limit.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setMaxRows(int)

getMaxRows

public int getMaxRows()
               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Returns the maximum number of rows that can be fetched from the statement's result set(s).
An optional method.

Specified by:
getMaxRows in interface IQuery
Returns:
the maximum number of rows that can be fetched from each result set of this IQuery; zero means there is no limit.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.getMaxRows()

clearInParameters

public void clearInParameters()
                       throws OdaException
Deprecated. 
Description copied from interface: IQuery
An optional method to clear the current input parameter values immediately.

In general, input parameter values remain in force for repeated use of a statement. Setting a parameter value automatically clears its previous value. However, to reset all the parameters to their default values without explicitly setting new values, use this method.

Specified by:
clearInParameters in interface IQuery
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.clearInParameters()

setInt

public void setInt(java.lang.String parameterName,
                   int value)
            throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given integer value.

Specified by:
setInt in interface IQuery
Parameters:
parameterName - name of the parameter.
value - integer value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setInt(java.lang.String, int)

setInt

public void setInt(int parameterId,
                   int value)
            throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given integer value.

Specified by:
setInt in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - integer value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setInt(int, int)

setDouble

public void setDouble(java.lang.String parameterName,
                      double value)
               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given double value.

Specified by:
setDouble in interface IQuery
Parameters:
parameterName - name of the parameter.
value - double value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setDouble(java.lang.String, double)

setDouble

public void setDouble(int parameterId,
                      double value)
               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given double value.

Specified by:
setDouble in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - double value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setDouble(int, double)

setBigDecimal

public void setBigDecimal(java.lang.String parameterName,
                          java.math.BigDecimal value)
                   throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given decimal value.

Specified by:
setBigDecimal in interface IQuery
Parameters:
parameterName - name of the parameter.
value - decimal value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setBigDecimal(java.lang.String, java.math.BigDecimal)

setBigDecimal

public void setBigDecimal(int parameterId,
                          java.math.BigDecimal value)
                   throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given decimal value.

Specified by:
setBigDecimal in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - decimal value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setBigDecimal(int, java.math.BigDecimal)

setString

public void setString(java.lang.String parameterName,
                      java.lang.String value)
               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given string value. An ODA runtime driver may or may not support setString() on a non-String type parameter. The format of the string parameter is implementation-dependent.

Specified by:
setString in interface IQuery
Parameters:
parameterName - name of the parameter.
value - string value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setString(java.lang.String, java.lang.String)

setString

public void setString(int parameterId,
                      java.lang.String value)
               throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given string value. An ODA runtime driver may or may not support setString() on a non-String type parameter. The format of the string parameter is implementation-dependent.

Specified by:
setString in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - string value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setString(int, java.lang.String)

setDate

public void setDate(java.lang.String parameterName,
                    java.sql.Date value)
             throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Date value.

Specified by:
setDate in interface IQuery
Parameters:
parameterName - name of the parameter.
value - the java.sql.Date value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setDate(java.lang.String, java.sql.Date)

setDate

public void setDate(int parameterId,
                    java.sql.Date value)
             throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Date value.

Specified by:
setDate in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - the java.sql.Date value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setDate(int, java.sql.Date)

setTime

public void setTime(java.lang.String parameterName,
                    java.sql.Time value)
             throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Time value.

Specified by:
setTime in interface IQuery
Parameters:
parameterName - name of the parameter.
value - the java.sql.Time value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setTime(java.lang.String, java.sql.Time)

setTime

public void setTime(int parameterId,
                    java.sql.Time value)
             throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Time value.

Specified by:
setTime in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - the java.sql.Time value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setTime(int, java.sql.Time)

setTimestamp

public void setTimestamp(java.lang.String parameterName,
                         java.sql.Timestamp value)
                  throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Timestamp value.

Specified by:
setTimestamp in interface IQuery
Parameters:
parameterName - name of the parameter.
value - the java.sql.Timestamp value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setTimestamp(java.lang.String, java.sql.Timestamp)

setTimestamp

public void setTimestamp(int parameterId,
                         java.sql.Timestamp value)
                  throws OdaException
Deprecated. 
Description copied from interface: IQuery
Sets the designated parameter to the given Timestamp value.

Specified by:
setTimestamp in interface IQuery
Parameters:
parameterId - id of the parameter (1-based).
value - the java.sql.Timestamp value.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setTimestamp(int, java.sql.Timestamp)

findInParameter

public int findInParameter(java.lang.String parameterName)
                    throws OdaException
Deprecated. 
Description copied from interface: IQuery
Returns the 1-based index of the specified input parameter.

Specified by:
findInParameter in interface IQuery
Parameters:
parameterName - name of the parameter.
Returns:
index of the parameter.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.findInParameter(java.lang.String)

getParameterMetaData

public IParameterMetaData getParameterMetaData()
                                        throws OdaException
Deprecated. 
Description copied from interface: IQuery
Returns the count, data types, and other metadata attributes of the parameters defined in this prepared IQuery object. Its implementation is required for ODA runtime drivers.

Note: This should only be called after prepare() is called.

Specified by:
getParameterMetaData in interface IQuery
Returns:
an IParameterMetaData object that contains information about this prepared IQuery object's parameters.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.getParameterMetaData()

setSortSpec

public void setSortSpec(SortSpec sortBy)
                 throws OdaException
Deprecated. 
Description copied from interface: IQuery
Specifies the sort specification for this IQuery. The setter must be called before this IQuery is executed or before getMoreResults is called. More sort keys can be added to the SortSpec after it is associated with the statement. The final sort specification is then applied to subsequent result set(s) at execution.

It is up to individual ODA runtme drivers to validate the type of sort specification that are acceptable to its data provider, based on its level of dynamic sorting support. An OdaException should be thrown if the specified sort specification is not valid or not supported by the driver.

Specified by:
setSortSpec in interface IQuery
Parameters:
sortBy - the sort specification assigned to this IQuery.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.setSortSpec(org.eclipse.birt.data.oda.SortSpec)

getSortSpec

public SortSpec getSortSpec()
                     throws OdaException
Deprecated. 
Description copied from interface: IQuery
Returns the sort specification associated with this IQuery.

Specified by:
getSortSpec in interface IQuery
Returns:
the SortSpec assigned to this IQuery; null if no SortSpec was explicitly set.
Throws:
OdaException - if data source error occurs.
See Also:
IQuery.getSortSpec()


Copyright © 2005 Actuate Corp. All rights reserved.