Hi Jon... Thanks for looking at the code. I agree that it is a very
"twisted"
use-case designed to twist a student's brains! I will take your advice
and
conclude the chapter with a more conventional discussion of exceptional
behavior. I have actually completed an Objective-C API that has two
versions of each method:
// EXCEPTIONAL METHODS
- (ResultSet *)executeWithExceptions
NSString *)SQL; // throws
exception on err
- (Data *)executeScalarWithExceptions
NSString *)SQL; // throws
exception on err
- (BOOL)executeNonQueryWithExceptions
NSString *)SQL; // throws
exception on err
- (NSString *)lastError;
- (ResultSet *)execute
NSString *)SQL;
- (BOOL)executeNonQuery
NSString *)SQL; // for update, insert and
delete
- (Data *)executeScalar
NSString *)SQL; // for returning autonumbers
Regards,
Jeff
I would choose a different use-case if I were you - my first thought
was, "Eek, don't do that - just use exceptions instead."<