SqlTask>>connect"Connect to Sybase using data that was originally read from 'parm.txt'"SybaseConnection unableToConnectToSQLserverSignalhandle:[:ex |self errorlogIt: SybaseErr.ex proceedBlock: [].ex proceedDoing: [self connectError raise]]do:[self connection: ExternalDatabaseConnection new.self connection username: UserName;password: Password;environment: ConnectString.self connection connect.self session: self connection getSession]
| Previous slide | Next slide | Back to first slide | View graphic version |
Notes:
It is necessary to be aware of serious problems that might arise during initialization and connection.
In rare instances, I used handle:do: to recover from Sybase issues that I knew were expected to occur on a frequent basis.
In this example the proceedBlock: and proceedDoing: were required to capture the 'unable to connect' exception, log it, then raise a different type of exception to abort the connection request