|
|
Sample Programs from NeXSTEP 3.3
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f2\fnil Times-Roman;\f1\fmodern Ohlfs;}
\paperw10800
\paperh11780
\margl120
\margr100
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 BinderExample
\b0\fs24 \
by Mai Nguyen, NeXT Developer Support Team\
\
\b\fs28 Overview
\b0\fs24 \
\
In order to run this example, you need to have a SYBASE server with a pubs database installed. The pubs database is a sample database provided with the SYBASE limited server package. \
\
This example shows how to use a DBBinder object to perform a simple query such as finding a paritcular author name and all the data related to that author (ie address, state, zip code, phone number). The key for the query can be the person's last name or the state of his residence.\
\
Note that the use of binders is generally not necessary if you use the higher level DBKit objects (such as TableView or DBModule), or if you use the DBRecordList object.\
However, binders can sometimes be handy if you need to connect objects and variables in your NeXTStep program to the external database directly.\
\
Please read the documentation on binders for more information.\
\fc1\cf1 \
\b\fs28 Program Organization
\b0\fs24 \
\
\b Major Classes in the Application
\b0 \
\
\
\pard\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-1900\li1900\fc1\cf1 BinderHandler A general handler object. A subclass of the Object class. Performs miscellaneous initialzations, and simple binder operations such as assigning a prototype to a binder, and retrieving data from the external database through that binder.\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \
\
\b\fs28 Topics Of Interest\
\b0\fs24 \
The purpose of this example is to show you some simple examples of the usage of the DBBinder object in the Access Layer:\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\f2\fs28\fc1\cf1 \
\f0\b\fs24 - How to initialize a binder object with an Objective-C prototype object:
\b0 \
See the method
\b initBinder:
\b0 in the file BinderHandler.m\
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \
-
\b How to build queries using the DBQualifier object and select records based on qualifiers:
\b0 \
See the method
\b findByName:
\b0 or
\b findByState:
\b0 in the file BinderHanlder.m\
\
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\b\fs28\fc1\cf1 Known Problems\
\b0\fs24 1) The program doesn't work if you don't get connected to the SYBASE server.
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.