home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / ODBCAD.Z / ODBCContext.h < prev    next >
Text File  |  1996-09-09  |  3KB  |  81 lines

  1. /*
  2.    ODBCContext.h
  3.    Copyright (c) 1996, NeXT Software, Inc.
  4.    All rights reserved.
  5. */
  6.  
  7. #import <EOAccess/EOAccess.h>
  8.  
  9. @interface ODBCContext:EOAdaptorContext
  10. {
  11.     void * _odbcDatabaseConnection; // HDBC
  12.     unsigned int _openChannelCount;
  13.     unsigned int _fetchesInProgress;
  14.     BOOL _isConnected;
  15. }
  16.  
  17. // Superclass overrides
  18.  
  19. - initWithAdaptor:(EOAdaptor *)anAdaptor;
  20.     // designated initializer. The context expects an ODBCAdaptor here.
  21.  
  22. - (void)beginTransaction;
  23.     // Attempts to begin a new transaction. Raises an exception if an error is
  24.     // encountered.
  25.  
  26. - (void)commitTransaction;
  27.     // Attempts to commit the last transaction begun. Raises an exception
  28.     // if an error is encountered. This method will raise an exception if
  29.     // any of the context's channels have a fetch in progress.
  30.  
  31. - (void)rollbackTransaction;
  32.     // Attempts to roll back the last transaction begun. Raises an exception
  33.     // if an error is encountered. This method will raise an exception if any
  34.     // of the context's channels have a fetch in progress.
  35.  
  36. - (BOOL)canNestTransactions;
  37.     // Returns NO.
  38.  
  39. - (unsigned)transactionNestingLevel;
  40.     // Returns the number of transactions in progress. Since transactions
  41.     // are not nested, this number is either 0 or 1.
  42.  
  43. - (EOAdaptorChannel *)createAdaptorChannel;
  44.     // Returns a new ODBCChannel.  Returns nil if a new channel cannot
  45.     // be created.  EOAdaptorContexts by default have no channels at all.
  46.     // The newly created channel retains its context.
  47.  
  48.  
  49. // ODBC Specific
  50.  
  51. - (void)odbcConnect;
  52. - (void)odbcDisconnect;
  53.     // Do not call these method directly,
  54.     // it's done automaticaly for you.
  55.  
  56. - (void)channelWillOpen;
  57. - (void)channelDidClose;
  58.     // The context keep a count of opened channels.
  59.     // The first WillOpen will generate an odbcConnect and
  60.     // the last DidClose a odbcDisconnect.
  61.  
  62. - (void)channelWillBeginFetching;
  63. - (void)channelDidEndFetching;
  64.     // The context keep a count of fetching channels in
  65.     // order to avoid commiting a transaction in a middle
  66.     // of a fetch.
  67.  
  68. - (void *)odbcDatabaseConnection;
  69.     // Returns the ODBC Database Connection Handle (HDBC)
  70. - (void)setOdbcDatabaseConnection:(void *)odbcDatabaseConnection;
  71.     // Could be called from the adaptorContextShouldConnect: delegate method
  72.     // to setup a connection in an alternate way (By using SQLBrowseConnect()
  73.     // for example).
  74.  
  75. - (NSDictionary *)odbcDriverInfo;
  76.     // Returns a dictionnary summarizing some important information about the
  77.     // driver (driver name, version, support NOT NULL, and other stuff). This
  78.     // method will connect to the database if the context is not yet connected. 
  79.  
  80. @end
  81.