RTSQLPlugin


Conforms To:
NSObject
Declared In:
RTSQLPlugin.h


Protocol Description

Protocol for a SQL Plugin that can open a session to a database


Method Types

- name
- loaded
- loadPlugin
- dbTypeConstant
- hostFieldName
- usesPort
- defaultPort
- usesUserid
- defaultUserid
- usesPassword
- usesDatabaseName
- databaseNameFieldName
- openConnectionWithParameters:
- openSession:port:userid:password:dbName:
- cloneSession:withZone:

Instance Methods

cloneSession:withZone:

- (id <RTSQLSession>)cloneSession:(id<RTSQLSession>)session withZone:(NSZone*)zone

Clones an existing session with the specified zone. Raises an exception if fails.


databaseNameFieldName

- (NSString*)databaseNameFieldName

Returns the plugin-specific name of the "databaseName" field. Raises an exception if the plugin is not loaded.


dbTypeConstant

- (FourCharCode)dbTypeConstant

Returns a FourCharCode representing this plugin. Each plugin has a unique code. Raises an exception if the plugin is not loaded.


defaultPort

- (UInt16)defaultPort

If usesPort is YES, returns the default port number. Defaults to zero. Raises an exception if the plugin is not loaded.


defaultUserid

- (NSString*)defaultUserid

If usesUserid is YES, returns the default value. Raises an exception if the plugin is not loaded.


hostFieldName

- (NSString*)hostFieldName

Returns the plugin-specific name of the "hostname" field. Raises an exception if the plugin is not loaded.


loadPlugin

- (BOOL)loadPlugin

Attempts to load/initialize the plugin and returns YES if successful (or if it was already loaded).


loaded

- (BOOL)loaded

Returns YES if this plugin is loaded and initialized.


name

- (NSString*)name

Returns the name of the plugin.


openConnectionWithParameters:

- (id <RTSQLSession>)openConnectionWithParameters:(NSDictionary *)dict

Standard method to open a new database connection. Raises exception if fails. inConnectDict is a dictionary of connection information. The following are the standard keys and values that can be in there. Individual plugins are free to add their own keys for any custom settings, but they should start with a lowercase letter to not conflict with future changes.

KeyTypeDescription
Standard Keys (all plugins should support connecting with these if possible)
HostNameNSString*host to connect to
PortNSNumber*(UInt16)port to connect to
UseridNSString*userid to connect as
PasswordNSString*password to connect with
InitDBNSString*catalog/database name to connect to
Other Keys
DBPasswordNSString*db password (such as with FrontBase)


openSession:port:userid:password:dbName:

- (id <RTSQLSession>)openSession:(NSString*)inHost port:(UInt16)inPort userid:(NSString*)inUserid password:(NSString*)inPassword dbName:(NSString*)inDBName

Opens and returns a new session to the requested server. Raises an exception if fails.


usesDatabaseName

- (BOOL)usesDatabaseName

Returns YES if this plugin accepts a database name as part of connection information. Raises an exception if the plugin is not loaded.


usesPassword

- (BOOL)usesPassword

Returns YES if this plugin accepts a password as part of connection information. Raises an exception if the plugin is not loaded.


usesPort

- (BOOL)usesPort

Returns YES if this plugin accepts a port number as part of connection information. Raises an exception if the plugin is not loaded.


usesUserid

- (BOOL)usesUserid

Returns YES if this plugin accepts a userid as part of connection information. Raises an exception if the plugin is not loaded.


Copyright ©2006 by Runtime Labs, Inc.. All Rights Reserved.