Advanced Database Feature Guide
- Change class references to AbtDatabaseConnection to UtyDB2Connection
- Use the DB2 method #isConnected to test the status of a connection rather
that the sequence "hdbc isNil".
- Replace senders of
AbtConnection>>#executeQuerySpec:withValues:ifError: with
UtyDB2SqlDescriptor>>#executeOn:* or
UtyDB2Connection>>#executeSql:*
- Replace senders of
AbtConnection>>#resultTableFromQuerySpec:withValues:ifError with
#scrollableResultSet being sent to the UtyDB2Result returned from
#executeOn:*
For Example, if the application had a method that looked like this:
| connection qs rs |
connection :=
AbtDatabaseConnection
connectToDatabaseNamed: 'SAMPLE'
userid: 'userid'
password: 'password'.
qs := AbtQuerySpec new
statement: 'SELECT * FROM STAFF'
yourself.
rs := connection resultTableFromQuerySpec: qs.
it could be reworked as follows:
| connection sd |
connection := UtyDB2DatabaseManager current
connectTo: 'NTSAMPLE' as: 'db2admin' password: 'unity'.
sd := connection newSqlDescriptor
sql: 'SELECT * FROM STAFF';
yourself.
rs := sd executeOn: connection.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]