home *** CD-ROM | disk | FTP | other *** search
/ OpenStep (Enterprise) / OpenStepENTCD.toast / OEDEPLOY / SYBASEAD.Z / SybaseAdaptor.h < prev    next >
Text File  |  1996-09-09  |  4KB  |  85 lines

  1. //  SybaseAdaptor.h
  2. //  Copyright 1994, NeXT Software, Inc.
  3.  
  4. #import    <EOAccess/EOAccess.h>
  5.  
  6. @class SybaseContext;
  7.  
  8. // Defines for keys in connection dictionary
  9. #define USERNAME    @"userName"
  10. #define HOSTNAME    @"hostName"
  11. #define DATABASENAME    @"databaseName"
  12. #define PASSWORD    @"password"
  13.  
  14. // If this key is present, it will be used as the setting to LC_ALL
  15. // used to specify the language and character set for server connections.
  16. // On J systems this option defaults to japanese
  17. #define LC_ALL_KEY @"LC_ALL"
  18.  
  19. // If this key is found in the connection dictionary with a value of "Yes",
  20. // the adaptor enables the System 10 Password encryption feature before
  21. // attempting to open a connection
  22. #define ENCRYPTPASSWORD    @"sybasePasswordEncryption"
  23.  
  24. // The SybaseAdaptor, SybaseContext, and SybaseChannel may raise exceptions
  25. // due to programming errors that result in invalid argument values or internal
  26. // inconsistencies. In addition, messages, errors, and failure status returned
  27. // from the Sybase SQL Server and client libraries may also result in
  28. // EOGeneralAdaptorExceptions. When an exception results from a call_back to
  29. // the CS_CLIENTMSG_CB (Sybase ClientMessage callback) or the CS_SERVERMSG_CB
  30. // (Sybase ServerMessage callback). All of the information passed into this
  31. // routine will be available in the userInfo dictionary contained by the
  32. // exception. When the exception was raised as a result to the clientMessage
  33. // callback, users can get the information provided by the client library by
  34. // asking:
  35. //   clientMsgDict = [[localException userInfo] objectForKey:@"sybaseClientMessageDictionary"];
  36.  
  37. // The clientMsgDict contains the following keys which have values corresponding
  38. // to those sent in the callback function that raised the exception: msgstring,
  39. // osstring, sqlstate, severity, msgnumber, osnumber, status.
  40.  
  41. // Similarly, when the exception was raised as a result to the serverMessage
  42. // callback, users can get the information provided by the server by asking:
  43. //   svrMsgDict = [[localException userInfo] objectForKey:@"sybaseServerMessageDictionary"];
  44.  
  45. // The svrMsgDict contains the following keys which have values corresponding
  46. // to those sent in the callback function that raised the exception: text,
  47. // svrname, proc, sqlstate, msgnumber, state, severity, line, status.
  48.  
  49. @interface SybaseAdaptor:EOAdaptor
  50. {
  51.     NSMutableDictionary *_typesByName;
  52.     NSMutableArray *_channels;
  53.     unsigned _connections;
  54.     struct
  55.     {
  56.     unsigned hasConnectedWithDictionary:1;
  57.     unsigned _RESERVED:31;
  58.     } _flags;
  59.  
  60. }
  61.  
  62. - (void)prepareEnvironmentForConnect;
  63. - (void)resetEnvironmentAfterConnect;
  64.     // These should bracket all calls to ct_connect() to set
  65.     // the LC_ALL environment variable setting to the
  66.     // value specified in the model connection dictionary.
  67.  
  68. - (void)sybaseContextWillConnect:(SybaseContext *)context;
  69. - (void)sybaseContextDidDisconnect:(SybaseContext *)context;
  70.  
  71. + (NSDictionary *)externalToInternalTypeMap;
  72.     // This method returns a dictionary that maps each predefined externalType
  73.     // known by the database to a default internal type.
  74. + (NSString *)primitiveTypeForExternalType:(NSString *)extType model:(EOModel *)model;
  75.     // For a given custom type defined on the server, return the
  76.     // primitive type on which it is based.
  77.  
  78. + (NSString *)internalTypeForExternalType:(NSString *)extType model:(EOModel *)model;
  79. + (NSArray *)externalTypesWithModel:(EOModel *)model;
  80.     // Defined in the EOAdaptor class as a methods that subclasses must implement
  81.     // to provide type information for the model file.
  82. @end
  83.  
  84.  
  85.