com.simba.dsi.core.interfaces
Interface IStatement

All Known Implementing Classes:
DSIStatement

public interface IStatement

An IStatement handles statement properties.


Method Summary
 void close()
          Closes the statement and releases any resources held by it.
 IDataEngine createDataEngine()
          Returns a new IDataEngine that can be used to execute queries and harvest metadata, in the context of this IStatement.
 java.lang.String getCursorName()
          Get that the current cursor name.
 Variant getCustomProperty(int propKey)
          Gets a custom statement property as identified by the given property key.
 int getCustomPropertyType(int propKey)
          Gets the type of the custom property associated with the given property key.
 com.simba.support.ILogger getLog()
          Gets the parent connection ILogger logging interface.
 IConnection getParentConnection()
          Gets the parent connection of the statement.
 Variant getProperty(int propKey)
          Gets a DSI statement property as identified by the given property key.
 Variant getSimilarValue(int propKey, Variant propValue)
          Gets a similar value to replace the given attribute value that is not supported.
 com.simba.support.IWarningListener getWarningListener()
          Gets the warning listener associated with this IStatement.
 boolean isCustomProperty(int propKey)
          Validates if the given property key is associated with a custom statement property.
 boolean isValueSupported(int propKey, Variant propValue)
          Determines if the given property key and value is supported.
 void notifyCursorNameChange(java.lang.String cursorName)
          Notifies that the cursor name has changed.
 void registerWarningListener(com.simba.support.IWarningListener listener)
          Registers a warning listener for allowing the IStatement to post warnings.
 void setCustomProperty(int propKey, Variant propValue)
          Sets a custom property, as identified by the given property key, with the given property value.
 void setProperty(int propKey, Variant propValue)
          Sets a DSI property, as identified by the given property key, with the given property value.
 

Method Detail

close

void close()
           throws com.simba.support.exceptions.ErrorException
Closes the statement and releases any resources held by it.

An IStatement is closed when the corresponding statement handle in ODBC is freed using SQLFreeHandle().

Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

createDataEngine

IDataEngine createDataEngine()
                             throws com.simba.support.exceptions.ErrorException
Returns a new IDataEngine that can be used to execute queries and harvest metadata, in the context of this IStatement.

Returns:
The newly created IDataEngine.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

getCursorName

java.lang.String getCursorName()
                               throws com.simba.support.exceptions.ErrorException
Get that the current cursor name.

Returns:
The current cursor name.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

getCustomProperty

Variant getCustomProperty(int propKey)
                          throws com.simba.support.exceptions.ErrorException
Gets a custom statement property as identified by the given property key.

Parameters:
propKey - Property key associated with a custom statement property.
Returns:
Property value associated with the given property key.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.
See Also:
Variant

getCustomPropertyType

int getCustomPropertyType(int propKey)
                          throws com.simba.support.exceptions.ErrorException
Gets the type of the custom property associated with the given property key.

Parameters:
propKey - Gets the type of the custom property associated with the given property key.
Returns:
Type of the custom property associated with the given property key.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

getLog

com.simba.support.ILogger getLog()
Gets the parent connection ILogger logging interface.

Returns:
Log for statement logging.
See Also:
ILogger

getParentConnection

IConnection getParentConnection()
Gets the parent connection of the statement.

Returns:
The parent connection of the statement.
See Also:
IConnection

getProperty

Variant getProperty(int propKey)
                    throws BadPropertyKeyException,
                           com.simba.support.exceptions.ErrorException
Gets a DSI statement property as identified by the given property key.

Parameters:
propKey - Property key associated with a DSI statement property.
Returns:
Property value associated with the given DSI property key.
Throws:
BadPropertyKeyException - If the input key is not valid.
com.simba.support.exceptions.ErrorException - If an error occurs.
See Also:
Variant

getSimilarValue

Variant getSimilarValue(int propKey,
                        Variant propValue)
                        throws com.simba.support.exceptions.ErrorException
Gets a similar value to replace the given attribute value that is not supported. Finds a similar value according to the following rules:
  1. If the max and min limits are the same, then only one value is supported and therefore no similar value will be returned.
  2. If the max and min limits are not the same, then this method will return the closest max/min limit value as the similar value.

Parameters:
propKey - Property key of the unsupported property
propValue - Property value of the unsupported property
Returns:
Variant with a similar value if a similar value can be found. Null if a similar value cannot be substituted.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

getWarningListener

com.simba.support.IWarningListener getWarningListener()
Gets the warning listener associated with this IStatement.

Returns:
The warning listener associated with this IStatement.

isCustomProperty

boolean isCustomProperty(int propKey)
                         throws com.simba.support.exceptions.ErrorException
Validates if the given property key is associated with a custom statement property.

Parameters:
propKey - Property key associated with a custom statement property.
Returns:
true if given property key is associated with a custom statement property, false if given property key is not recognized.
Throws:
com.simba.support.exceptions.ErrorException - If there is an error checking if the property exists.

isValueSupported

boolean isValueSupported(int propKey,
                         Variant propValue)
                         throws com.simba.support.exceptions.ErrorException
Determines if the given property key and value is supported.

Parameters:
propKey - Property key of the property to be validated.
propValue - Property value of the property to be validated.
Returns:
true if the property key and value is supported; false otherwise.
Throws:
com.simba.support.exceptions.ErrorException - If limit key information could not be found.
See Also:
Variant

notifyCursorNameChange

void notifyCursorNameChange(java.lang.String cursorName)
                            throws com.simba.support.exceptions.ErrorException
Notifies that the cursor name has changed.

Parameters:
cursorName - The changed cursorName.
Throws:
com.simba.support.exceptions.ErrorException - If an error occurs.

registerWarningListener

void registerWarningListener(com.simba.support.IWarningListener listener)
Registers a warning listener for allowing the IStatement to post warnings.

Parameters:
listener - The listener to register with this IStatement.

setCustomProperty

void setCustomProperty(int propKey,
                       Variant propValue)
                       throws BadAttrValException,
                              com.simba.support.exceptions.ErrorException
Sets a custom property, as identified by the given property key, with the given property value. If the value is substituted with another value before storage, an OPT_VAL_CHANGED_WARNING warning should be posted in the warnings holder. For properties which accept more than just a discrete set of values, this method should throw a BadAttrValException if an illegal value is given which can't be substituted with another value.

Parameters:
propKey - Property key associated with a custom statement property.
propValue - Property value to be set on the custom statement property associated with the given property key.
Throws:
BadAttrValException - If an illegal value is given which can't substituted with another value.
com.simba.support.exceptions.ErrorException - If an unspecified error occurs.
See Also:
Variant

setProperty

void setProperty(int propKey,
                 Variant propValue)
                 throws BadAttrValException,
                        com.simba.support.exceptions.ErrorException
Sets a DSI property, as identified by the given property key, with the given property value. If the value is substituted with another value before storage, an OPT_VAL_CHANGED_WARNING warning should be posted in the warnings holder. For properties which accept more than just a discrete set of values, this method should throw a BadAttrValException if an illegal value is given which can't be substituted with another value.

Parameters:
propKey - Property key associated with a DSI statement property.
propValue - Property value to be set on the DSI statement property associated with the given property key.
Throws:
BadAttrValException - If the input value is not valid for the key.
com.simba.support.exceptions.ErrorException - If an error occurs.
See Also:
Variant


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.