PATH  WebObjects 4.0 Documentation > ODBCEOAdaptor Reference



ODBCChannel

Inherits From:
EOAdaptorChannel : NSObject

Inherits From:
com.apple.yellow.odbceoadaptor


Class Description

An ODBCChannel represents an independent communication channel to the database server its ODBCAdaptor is connected to. All of an ODBCChannel's operations take place within the context of transactions controlled or tracked by its ODBCContext. An ODBCContext can manage multiple ODBCChannels, and a channel is associated with only one context.

The features ODBCChannel adds to EOAdaptorChannel are methods for returning the ODBC Statement Handle (HSTMT), and for returning a dictionary-formatted result from SQLTypeInfo().


Method Types

Getting type information
odbcTypeInfo
Opening and closing a channel
openChannel
closeChannel
isOpen
Modifying rows
deleteRowsDescribedByQualifier
insertRow
Fetching rows
selectAttributesWithFetchSpecification
fetchRow
attributesToFetch
cancelFetch
describeResults
setAttributesToFetch
isFetchInProgress
Sending SQL to the server
evaluateExpression

Instance Methods


attributesToFetch

public com.apple.yellow.foundation.NSArray attributesToFetch()

Overrides the EOAdaptorChannel method attributesToFetch to return the set of attributes to retrieve with fetchRow.


cancelFetch

public void cancelFetch()

Overrides the EOAdaptorChannel method cancelFetch to clear all result sets established by the last selectAttributesWithFetchSpecification or evaluateExpression message and terminate the current fetch, so that isFetchInProgress returns NO.


closeChannel

public void closeChannel()

Overrides the EOAdaptorChannel method closeChannel to close the channel so that it can't perform operations with the server. Any fetch in progress is canceled. This method has the side effect of closing the receiver's adaptor context's connection with the database if the receiver is its adaptor context's last open channel.


deleteRowsDescribedByQualifier

public int deleteRowsDescribedByQualifier(com.apple.yellow.eocontrol.EOQualifier qualifier, com.apple.yellow.eoaccess.EOEntity entity)

Overrides the EOAdaptorChannel method deleteRowsDescribedByQualifier to delete the rows described by qualifier and return the number of rows deleted. Raises an exception on failure. Some possible reasons for failure are:


describeResults

public com.apple.yellow.foundation.NSArray describeResults()

Overrides the EOAdaptorChannel method describeResults to return an array of EOAttributes describing the properties available in the current result set, as determined by selectAttributesWithFetchSpecification or a statement evaluated by evaluateExpression. Raises an exception if an error occurs.


evaluateExpression

public void evaluateExpression(com.apple.yellow.eoaccess.EOSQLExpression expression)

Overrides the EOAdaptorChannel method evaluateExpression to send expression to the database server for evaluation, beginning a transaction first and committing it after evaluation if a transaction isn't already in progress. Raises an exception if an error occurs.


fetchRow

public com.apple.yellow.foundation.NSMutableDictionary fetchRow()

Overrides the EOAdaptorChannel method fetchRow to fetch the next row from the result set of the last selectAttributesWithFetchSpecification or evaluateExpression message sent to the receiver. Returns values for the receiver's attributesToFetch. When there are no more rows in the current result set, this method returns null, and invokes the delegate method adaptorChannelDidChangeResultSet if there are more results sets. When there are no more rows or result sets, this method returns null, ends the fetch, and invokes adaptorChannelDidFinishFetching. isFetchInProgress returns true until the fetch is canceled or until this method exhausts all result sets and returns null. Raises an exception if an error occurs.


insertRow

public void insertRow(com.apple.yellow.foundation.NSDictionary row, com.apple.yellow.eoaccess.EOEntity entity)

Overrides the EOAdaptorChannel method insertRow to insert the values of row into the table in the database that corresponds to entity. row is an NSDictionary whose keys are attribute names and whose values are the values to insert. Raises an exception on failure. Some possible reasons for failure are:


isFetchInProgress

public boolean isFetchInProgress()

Overrides the EOAdaptorChannel method isFetchInProgress to return true if the receiver is fetching, false otherwise. An adaptor channel is fetching if:

An adaptor channel stops fetching when there are no more records to fetch or when it's sent a cancelFetch message.


isOpen

public boolean isOpen()

Overrides the EOAdaptorChannel method isOpen to return true if the channel has been opened with openChannel, false if not.


odbcTypeInfo

public com.apple.yellow.foundation.NSDictionary odbcTypeInfo()

Returns the result from SQLTypeInfo(), formatted in an NSDictionary ready to incorporate into a model file.


openChannel

public void openChannel()

Overrides the EOAdaptorChannel method openChannel to put the channel and both its context and adaptor into a state where they are ready to perform database operations. Raises an exception if error occurs.


selectAttributesWithFetchSpecification

public void selectAttributesWithFetchSpecification(com.apple.yellow.foundation.NSArray attributes, com.apple.yellow.eocontrol.EOFetchSpecification fetchSpecification,
boolean flag,
com.apple.yellow.eoaccess.EOEntity entity)

Overrides the EOAdaptorChannel method selectAttributesWithFetchSpecification to select attributes in rows matching the qualifier in fetchSpecification and set the receiver's attributes to fetch. The selected rows compose one or more result sets, each row of which will be returned by subsequent fetchRow messages according to fetchSpecification's sort orderings. If flag is true, the rows are locked if possible so that no other user can modify them (the lock specification in fetchSpecification is ignored). Raises an exception if an error occurs. Some possible reasons for failure are:


setAttributesToFetch

public void setAttributesToFetch(com.apple.yellow.foundation.NSArray attributes)

Overrides the EOAdaptorChannel method setAttributesToFetch to change the set of attributes used to describe the fetch data in the middle of a select. This method raises an exception if invoked when there is no fetch in progress.


updateValuesInRowsDescribedByQualifier

public int updateValuesInRowsDescribedByQualifier(com.apple.yellow.foundation.NSDictionary row, com.apple.yellow.eocontrol.EOQualifier qualifier,
com.apple.yellow.eoaccess.EOEntity entity)

Overrides the EOAdaptorChannel method updateValuesInRowsDescribedByQualifier to update the rows described by qualifier with the values in values. values is an NSDictionary whose keys are attribute names and whose values are the new values for those attributes (the dictionary need only contain entries for the attributes being changed). Returns the number of updated rows. Raises an exception if an error occurs. Some possible reasons for failure are:





Copyright © 1998, Apple Computer, Inc. All rights reserved.