|
|
Sample Programs from NeXSTEP 3.3
{\rtf0\ansi{\fonttbl\f0\fswiss Helvetica;\f1\fmodern Ohlfs;}
\paperw11700
\paperh9320
\margl120
\margr120
{\colortbl;\red0\green0\blue0;}
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\b\i0\ulnone\fs36\fc0\cf0 SQLExecutor
\b0\fs24 \
by Mai Nguyen, NeXT Developer Support\
\
\b\fs28 Overview
\f1\b0\fs20 \
\f0\fs24 This example shows how to evaluate any arbitrary SQL statement for either the sybase or oracle adaptor.\
If you use the Sybase adaptor, you will also be able to execute stored procedures that return computed rows or status rows. You must programmatically determine the type of rows returned in order to properly display the result sets. (see SybaseDelegate.[hm]).\
If you use the Oracle adaptor, you can execute the stored procedures, but you cannot process the results being returned.\
For example, you can enter the following Oracle procedure in the evaluation panel:\
\
\pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\f1\fs20\fc0\cf0 BEGIN dbms_output.put_line('foobar'); END;
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\f0\fs24\fc0\cf0 \
\fc1\cf1 \
\b\fs28 Program Organization\
\b0\fs24 \
\b Major Classes in the Application
\b0 \
\pard\tx2160\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-2140\li2140\fc1\cf1 \
Evaluator A generic object responsible for evaluating the SQL string
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1
\pard\tx2160\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-2140\li2140\fc1\cf1 \
\
SybaseDelegate A delegate object responsible for handling the case of stored procedures that return computed rows
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \
\pard\tx2160\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fi-2140\li2140\fc1\cf1
\pard\tx960\tx1920\tx2880\tx3840\tx4800\tx5760\tx6720\tx7680\tx8640\tx9600\fc1\cf1 \
\b\fs28 Topics Of Interest\
\pard\tx520\tx1060\tx1600\tx2120\tx2660\tx3200\tx3720\tx4260\tx4800\tx5320\fs24\fc1\cf1 \
How to open a connection to a database and close it via a model file\
\b0 See the file Controller.m, method
\b open:sender
\b0 \
\b \
How to evaluate a stored procedure or any other SQL string
\b0 \
This is done in the Evaluator class. See the method
\b evaluate:
\b0 in the file Evaluator.m. See also the files
\b SybaseDelegate.[hm]
\b0 \
\b \
\pard\tx1340\tx2680\tx4020\tx5360\tx6720\tx8060\tx9400\tx10740\tx12080\tx13440\b0\fc1\cf1 \
\pard\tx1140\tx2300\tx3440\tx4600\tx5760\tx6900\tx8060\tx9200\tx10360\tx11520\fc1\cf1 Valid for NEXTSTEP Release 3.2 installed with the Enterprise Objects Framework Release 1.0, 1.1
\pard\tx1340\tx2680\tx4020\tx5360\tx6720\tx8060\tx9400\tx10740\tx12080\tx13440\fc1\cf1 \
}
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.