JP2767767B2 - Data processing apparatus and method for accessing relational database - Google Patents

Data processing apparatus and method for accessing relational database

Info

Publication number
JP2767767B2
JP2767767B2 JP4020745A JP2074592A JP2767767B2 JP 2767767 B2 JP2767767 B2 JP 2767767B2 JP 4020745 A JP4020745 A JP 4020745A JP 2074592 A JP2074592 A JP 2074592A JP 2767767 B2 JP2767767 B2 JP 2767767B2
Authority
JP
Japan
Prior art keywords
data
relational database
routine
access
data access
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Lifetime
Application number
JP4020745A
Other languages
Japanese (ja)
Other versions
JPH0561746A (en
Inventor
ロナルド・ビー・ベーカー
キャシー・ジェー・カベンディッシュ
ケビン・エル・サイツェ
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Publication of JPH0561746A publication Critical patent/JPH0561746A/en
Application granted granted Critical
Publication of JP2767767B2 publication Critical patent/JP2767767B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【産業上の利用分野】本発明は一般に改良されたデータ
検索システム、特にオブジェクト指向環境外の関係デー
タベースのデータを検索するための方法および装置に関
する。本発明をより具体的に言えば、オブジェクト指向
環境から出ることなくデータを検索する方法および装置
に関する。
FIELD OF THE INVENTION The present invention relates generally to an improved data retrieval system, and more particularly to a method and apparatus for retrieving data in a relational database outside of an object-oriented environment. More particularly, the invention relates to a method and apparatus for retrieving data without leaving the object-oriented environment.

【0002】[0002]

【従来の技術】オブジェクト指向言語は拡張可能性およ
びコードの再使用可能性という利点を持っているけれど
も、オブジェクト指向環境において、この環境外の関係
データベースのデータをアクセスすることが必要な場合
がある。現時点において、現存の関係データベースがオ
ブジェクト指向データベースとして再設計され書直され
るようなオブジェクト指向データベースが検討されてい
るが、現在の電子事務処理環境において膨大な量のデー
タが既に存在する関係データベースに含まれている。こ
のような状態で、オブジェクト指向環境から出ることな
く、これらの関係データベースのデータをアクセスする
必要がある。不幸なことに、現在のところ、オブジェク
ト指向環境を出ないで関係データベースのデータを検索
するシステムは真の意味のオブジェクト指向環境には存
在しない。現在のところ、オブジェクト指向環境内の個
々の作業では、従来の関係データベースのアクセス技術
を使用してデータをアクセスするためには、オブジェク
ト指向環境から出なければならない。
BACKGROUND OF THE INVENTION Although object oriented languages have the advantage of extensibility and code reusability, in an object oriented environment it may be necessary to access data in relational databases outside this environment. . At present, an object-oriented database in which an existing relational database is redesigned and rewritten as an object-oriented database is under consideration. Have been. In such a state, it is necessary to access the data of these relational databases without leaving the object-oriented environment. Unfortunately, at present, no system for searching relational database data without leaving the object-oriented environment exists in a true object-oriented environment. Currently, individual tasks within an object-oriented environment must exit the object-oriented environment in order to access data using conventional relational database access techniques.

【0003】オブジェクト指向環境におけるオブジェク
トは関連するコードおよびデータで構成されている。オ
ブジェクトは各オブジェクトに対して独特である方法の
ライブラリを有し、これにより各オブジェクトが固有の
挙動を付与される。オブジェクトのクラスは1つ以上の
性質に基づいたグループを定義し、インスタンスは1つ
のクラス内の単1の項目である。例えば、オブジェクト
のクラスは弁護士、医者、技術者、プログラマのような
専門職であり、オブジェクトのインスタンスはそのクラ
スの中の特定の個人であると考えることができる。
[0003] Objects in an object-oriented environment are composed of related code and data. Objects have a library of methods that are unique to each object, which gives each object a unique behavior. An object class defines a group based on one or more properties, and an instance is a single item in a class. For example, a class of an object may be a profession, such as a lawyer, doctor, technician, or programmer, and an instance of the object may be considered to be a particular individual in the class.

【0004】1つのクラスは新しいインスタンスを解釈
する方法と、1つのインスタンスがどのようにして入力
メッセージに対して振舞いかつ反応するかを定義するイ
ンスタンス法を定義する。インスタンス変数は個人の給
与のようなオブジェクトの1つのインスタンスの特定の
特徴を定義する。これらのインスタンス変数は定義され
てもよいし、定義待ち状態でブランクであってもよい。
インスタンスのデータ構造はインスタンス変数の集合体
によって記述される。オブジェクト形式の構造を指し示
すのにポインタが使用される。
[0004] One class defines how to interpret a new instance and an instance method that defines how one instance behaves and reacts to an incoming message. Instance variables define certain characteristics of one instance of an object, such as an individual's salary. These instance variables may be defined, or may be blank in a definition waiting state.
The data structure of an instance is described by a set of instance variables. Pointers are used to point to object-type structures.

【0005】Smalltalk-80はアプリケーションを構成す
るためにモデル・ビュー・コントローラ体系を使用して
いる。モデル・オブジェクトはデータを引き出し処理す
る機能を持っており、他方、ビュー・オブジェクトはス
クリーンの表示およびユーザとの対話を司る。ビュー・
オブジェクトはアプリケーション・フローを管理し、デ
ータを検索または修正するためにモデル・オブジェクト
にメッセージを送る。コントローラは外部装置からの入
力信号および出力信号を管理する。
[0005] Smalltalk-80 uses a model-view-controller architecture to construct applications. Model objects have the ability to retrieve and process data, while view objects are responsible for displaying the screen and interacting with the user. View
Objects manage application flows and send messages to model objects to retrieve or modify data. The controller manages input signals and output signals from external devices.

【0006】オブジェクト指向環境と関係データベース
との間には、基本的な非互換性が存在する。オブジェク
ト指向環境はデータ構造を指し示す多数のポインタがあ
るのに反して、関係データベースは構成が平坦である。
従って、オブジェクト指向環境内のデータ間の関係はデ
ータ・オブジェクトの構造に組み込まれている。関係デ
ータベースはデータ記憶に対して平坦なテーブル指向ア
プローチを使用しているので、関係データベースの関係
はデータ記憶技術の一部として明示されていない。この
ことが関係データベースに記憶されたデータをオブジェ
クト指向フオーマットに変換するのを困難にしている。
[0006] There is a fundamental incompatibility between an object-oriented environment and a relational database. The object-oriented environment has many pointers to data structures, whereas the relational database has a flat structure.
Thus, the relationships between the data in the object-oriented environment are built into the structure of the data object. Because relational databases use a flat table-oriented approach to data storage, the relations of the relational database are not specified as part of the data storage technology. This makes it difficult to convert the data stored in the relational database into an object-oriented format.

【0007】例えば、ディジトーク社(Digitalk, Inc.)
の製品であるSmalltalk V/PMの言語は外部の関係データ
ベースへ直接にアクセスすることをサポートしない。然
しながら、この言語はOS/2のダイナミック・リンク・ラ
イブラリ(DLL)ルーチンを呼び出し、パラメータをそれ
らのルーチンに転送させることができる。不幸にして、
単一の値だけがルーチンから戻される。通常、これはハ
ーフ・ワードの整数またはポインタである。1つの戻り
はオブジェクト形式の1つの構造を指し示さなければな
らないので、上述の制限は1つの行に対して複数の列の
値を戻し、それらをインスタンス変数に直接に割り当て
ることを困難にしている。
For example, Digitalk, Inc.
The product Smalltalk V / PM language does not support direct access to external relational databases. However, the language can call OS / 2 dynamic link library (DLL) routines and have the parameters transferred to those routines. Unfortunately,
Only a single value is returned from the routine. Typically, this is a half word integer or pointer. The above restrictions make it difficult to return multiple column values for one row and assign them directly to instance variables, since one return must point to one structure of the object form. .

【0008】C++言語は直接アクセスによって関係デー
タベースからCプログラム言語のデータの検索を可能に
するが、この言語はオブジェクト指向プログラミング用
のC言語の1つの拡張である。これはC言語へクラス構
造を付加するけれども、C言語の改良に主として向けら
れる。C++言語はハイブリッド言語であって、オブジェ
クト指向言語ではない。C++言語における環境のコンセ
プトはすべてのメッセージが動的拘束を使用するSmallt
alkの言語と同じではない。
The C ++ language allows direct access to retrieve C programming language data from a relational database, which is an extension of the C language for object-oriented programming. Although this adds class structure to the C language, it is primarily aimed at improving the C language. The C ++ language is a hybrid language, not an object-oriented language. The concept of the environment in the C ++ language is Smallt, where all messages use dynamic constraints.
Not the same as alk language.

【0009】[0009]

【発明が解決しようとする課題】従つて、ユーザがオブ
ジェクト指向環境から出ることなく、関係データベース
のデータをアクセスする方法および装置が必要であるこ
とは明らかである。
Thus, it is apparent that there is a need for a method and apparatus for accessing data in a relational database without leaving the user from an object-oriented environment.

【0010】本発明の目的は改良されたデータ・アクセ
ス・システムを提供することにある。
It is an object of the present invention to provide an improved data access system.

【0011】本発明の他の目的はオブジェクト指向環境
外の関係データベースのデータをアクセスするための方
法および装置を提供することにある。
It is another object of the present invention to provide a method and apparatus for accessing data in a relational database outside of an object-oriented environment.

【0012】本発明の他の目的はオブジェクト指向環境
から出ないで関係データベースのデータをアクセスする
ための方法および装置を提供することにある。
It is another object of the present invention to provide a method and apparatus for accessing data in a relational database without leaving the object-oriented environment.

【0013】[0013]

【課題を解決するための手段】本発明の方法および装置
はオブジェクト指向環境から出ないでオブジェクト指向
環境外の関係データベースにアクセスすることを可能に
する。オブジェクト指向環境の要求元オブジェクトはオ
ブジェクト指向環境外の関係データベースに置かれたデ
ータを要求するデータ・アクセス・メッセージを送る。
このメッセージはインターフェースに送られ、これはデ
ータ・アクセス要求からの結果を保持するためにインス
タンス変数を含むデータ・オブジェクトを作成する。こ
のインターフェースは関係データベースからのデータを
アクセスするデータ・アクセスのルーチンを実行し、そ
の結果はデータ・オブジェクト内におかれる。そして、
データ・オブジェクトに対するポインタが要求元オブジ
ェクトに送られる。
SUMMARY OF THE INVENTION The method and apparatus of the present invention allows access to a relational database outside an object-oriented environment without leaving the object-oriented environment. The requesting object in the object oriented environment sends a data access message requesting data located in a relational database outside the object oriented environment.
This message is sent to the interface, which creates a data object containing instance variables to hold the results from the data access request. This interface executes a data access routine that accesses data from the relational database, and places the result in a data object. And
A pointer to the data object is sent to the requesting object.

【0014】[0014]

【実施例】図1を参照すると、本発明の方法を適用する
ことのできるデータ処理システム8が示されている。図
示されているように、データ処理システム8はローカル
・エリア・ネットワーク(LAN)10および32のような
複数のネットワークを含んでいる。このローカル・エリ
ア・ネットワークの各々は好ましくは複数の個々のコン
ピユータ12および30を含んでいる。勿論、ホストプ
ロセッサに接続された複数個のインテリジェント・ワー
クステーション(IWS)をこのようなネットワークに使用
できることは当業者には理解されるであろう。
1, there is shown a data processing system 8 to which the method of the present invention can be applied. As shown, data processing system 8 includes a plurality of networks, such as local area networks (LANs) 10 and 32. Each of the local area networks preferably includes a plurality of individual computers 12 and 30. Of course, those skilled in the art will appreciate that a plurality of intelligent workstations (IWS) connected to a host processor can be used in such a network.

【0015】このようなデータ処理システムで一般に行
われているように、各コンピュータが記憶装置14およ
びプリンタ/出力装置に結合されている。データ処理シ
ステム8のすべてのユーザによって周期的にアクセスさ
れる文書、即ちリソース・オブジェクトを記憶するため
に、このような記憶装置14が本発明の方法に従って使
用される。記憶装置14内に記憶された文書、即ちリソ
ース・オブジェクトの各々は例えば個々のコンピユータ
12または30のユーザへ文書を転送することによっ
て、データ処理システム8を介して自由に交換される。
As is common in such data processing systems, each computer is coupled to a storage device 14 and a printer / output device. Such a storage device 14 is used in accordance with the method of the present invention to store documents, i.e., resource objects, which are periodically accessed by all users of the data processing system 8. The documents, i.e. each of the resource objects, stored in the storage device 14 are freely exchangeable via the data processing system 8, for example by transferring the documents to the user of the individual computer 12 or 30.

【0016】図1において、データ処理システム8は通
信リンク24によってローカル・エリア・ネットワーク
(LAN)10に結合されているのが好ましいメインフレー
ム・コピユータ18のような複数のメインフレーム・コ
ンピユータを含んでいる。また、メインフレーム・コン
ピユータ18はローカル・エリア・ネットワーク(LAN)
10用の遠隔記憶として役立つ記憶装置20に接続する
こともできる。同様に、ローカル・エリア・ネットワー
ク10は通信リンク24を介してサブシステム制御ユニ
ット/通信コントローラ26および通信リンク34を経
てゲートウェイ・サーバー28に結合されている。ゲー
トウェイ・サーバー28はローカル・エリア・ネットワ
ーク32をローカル・エリア・ネットワーク10にリン
クするのに役立つ個々のコンピユータ、即ち対話式のワ
ークステーション(IWS)であるのが好ましい。
In FIG. 1, data processing system 8 is connected by a communication link 24 to a local area network.
It includes a plurality of mainframe computers, such as a mainframe computer 18, which is preferably coupled to (LAN) 10. The mainframe computer 18 is a local area network (LAN)
It can also be connected to a storage device 20 which serves as a remote storage for 10. Similarly, local area network 10 is coupled via communication link 24 to subsystem server / communication controller 26 and to gateway server 28 via communication link 34. Gateway server 28 is preferably a separate computer, or interactive workstation (IWS), that serves to link local area network 32 to local area network 10.

【0017】ローカル・エリア・ネットワーク32およ
び10に関して前述したように、複数の文書またはリソ
ース・オブジェクトは記憶装置20内に記憶され、記憶
されたリソース・オブジェクトのためのリソース・マネ
ージヤまたはライブラリ・サービスとしてメインフレー
ム・コンピユータ18によって制御される。勿論、メイ
ンフレーム・コンピユータ18はローカル・エリア・ネ
ットワーク10から地理的に遠く離れて設置され、同様
に、ローカル・エリア・ネットワーク10はローカル・
エリア・ネットワーク32から離れた遠隔地に設置され
ることは当業者は理解できるであろう。例えば、ローカ
ル・エリア・ネットワーク10をテキサス州に設置し、
メインフレーム・コンピユータ18はニユーヨーク州に
設置される。
As described above with respect to local area networks 32 and 10, a plurality of documents or resource objects are stored in storage device 20 and as a resource manager or library service for the stored resource objects. It is controlled by the mainframe computer 18. Of course, mainframe computer 18 is located geographically remote from local area network 10, and similarly, local area network 10 is
Those skilled in the art will appreciate that the remote location is remote from the area network 32. For example, setting up a local area network 10 in Texas,
Mainframe computer 18 is located in New York.

【0018】分散データ処理システム8内で、個々のユ
ーザは個々のコンピユータ12および30で異なったプ
ログラムを実行することができ、分散データ処理システ
ム8の他の領域をアクセスすることができる。例えば、
1人のユーザは1つのオブジェクト指向環境を使用し、
メインフレーム・コンピユータ18の関係データベース
または幾つかの場所にある記憶装置14、20の関係デ
ータベースをアクセスすることができる。
Within the distributed data processing system 8, individual users can execute different programs on individual computers 12 and 30, and have access to other areas of the distributed data processing system 8. For example,
One user uses one object-oriented environment,
The relational database of the mainframe computer 18 or the storage 14, 20 at some location can be accessed.

【0019】データの構成および構造の差異のために、
オブジェクト指向環境からの関係データベースへのアク
セスに問題が生じる。特定のオブジェクト指向環境に適
用される特定のアプリケーションを以下に説明する。
Due to differences in data structure and structure,
Problems arise in accessing relational databases from object-oriented environments. Specific applications that apply to specific object-oriented environments are described below.

【0020】図2を参照すると、ユーザがオブジェクト
指向環境から出ることなく、関係データベースにアクセ
スするための好ましい実施例が図示されている。この実
施例で使用するのに適した1つのオブジェクト指向環境
はIBM社の製品であるオフイスビジョン(Office Visio
n)プログラムである。図示されているように、分散デ
ータ処理システム8はアドレスブック・ウインドゥ40
を含むオブジェクト指向環境を含む。アドレスブック・
ウインドゥ40はオブジェクト指向環境内の1つのオブ
ジェクトである。ユーザがエントリ・アイコン42を選
択すると、アドレスブック・レコード・ウインドゥ52
がオープンされる。アドレスブック・レコード・ウイン
ドゥ52は関係データベース48からのアドレスブック
・レコード・エントリを含んでいる。
Referring to FIG. 2, a preferred embodiment is illustrated for a user to access a relational database without leaving the object-oriented environment. One object-oriented environment suitable for use in this embodiment is IBM's product OfficeVisio.
n) It is a program. As shown, the distributed data processing system 8 includes an address book window 40.
Including object-oriented environments. Address book
Window 40 is one object in the object-oriented environment. When the user selects the entry icon 42, the address book record window 52
Is opened. Address book record window 52 contains address book record entries from relational database 48.

【0021】アドレスブック・ウインドゥ40のユーザ
は、要求元オブジェクト(アドレスブック・レコード4
6)、インターフェース・オブジェクト50および関係
データベース48の間の対話を見ることはない。アドレ
スブック・レコード46はデータを得るべくメッセージ
をインターフェース・オブジェクト50へ送る要求元オ
ブジェクトである。このインターフェース・オブジェク
ト50は要求を問合せに変換し、その問合せは関係デー
タベース48に送られ、返事として問合せ結果を受け取
る。次に、インターフェース・オブジェクト50は問い
合せ結果を要求元オブジェクトのアドレスブック・レコ
ードによって認識できるフオーマットに変換する。イン
ターフェース・オブジェクト50はアドレスブック・レ
コード46に、要求されたデータの位置を含むポインタ
を転送する。アドレスブック・レコード46はインター
フェース・オブジェクト50から戻された結果を表示す
る。
The user of the address book window 40 receives the requesting object (address book record 4).
6), no interaction between the interface object 50 and the relational database 48 is seen. Address book record 46 is the requesting object that sends a message to interface object 50 to get the data. This interface object 50 translates the request into a query, which is sent to the relational database 48 and receives the query result in reply. Next, the interface object 50 converts the query result into a format recognizable by the address book record of the requesting object. Interface object 50 transfers a pointer to address book record 46 containing the location of the requested data. Address book record 46 displays the results returned from interface object 50.

【0022】図3はオブジェクト指向言語Smalltalk V/
PMと、関係データベースを問合せるための周知の言語で
ある構造化された問合せ言語(SQL)を使用した関係デー
タベースとを含む本発明の好ましい実施例を示す図であ
る。
FIG. 3 shows an object-oriented language Smalltalk V /
FIG. 3 illustrates a preferred embodiment of the present invention that includes a PM and a relational database using Structured Query Language (SQL), a well-known language for querying relational databases.

【0023】この実施例では、インターフェース50は
テーブル・オブジェクト63、トランスレータ・オブジ
ェクト66、問合せオープン・ルーチン68、問合せ取
り出しルーチン70およびコミット・ルーチン72を備
えている。テーブル・オブジェクト63はデータ・オブ
ジェクトを作成し、問合せオープン・ルーチン68、問
合せ取り出しルーチン70およびコミット・ルーチン7
2は関係データベース80をアクセスしてデータ・オブ
ジェクトにデータを配置するのに使用されるデータ・ア
クセス・ルーチンを備えている。各データ・オブジェク
トは関係データベース80の1つの行からのデータを含
み、かつ対応するのが好ましい。トランスレータ・オブ
ジェクト66はダイナミック・リンク・ライブラリ(DL
L)を含み、適当なデータ・アクセス・ルーチンにアプリ
ケーション・プログラム・インターフェース(API)を呼
び出す。
In this embodiment, interface 50 includes a table object 63, a translator object 66, a query open routine 68, a query fetch routine 70, and a commit routine 72. The table object 63 creates a data object, and the query open routine 68, the query fetch routine 70 and the commit routine 7
2 comprises a data access routine used to access the relational database 80 and place data in data objects. Each data object preferably contains and corresponds to data from one row of the relational database 80. The translator object 66 is a dynamic link library (DL
L) to call the application program interface (API) to the appropriate data access routine.

【0024】関係データベースの複数行が1つの問合せ
にマッチすることがある。問合せにマッチした各行は1
つのデータ・オブジェクトに対応する。データ・オブジ
ェクトのポインタは1つの集合体にされ、テーブル・オ
ブジェクト63は集合体に対するポインタを要求元オブ
ジェクト60に戻す。この集合体は例えばポインタのア
レーまたはリンクされたポインタのリストでよく、集合
体はアレーまたはリンクされたリストのヘッドへポイン
タを戻すことによって返される。
Multiple rows of the relational database may match one query. Each row that matches the query is 1
Corresponding to one data object. The data object pointers are aggregated and the table object 63 returns a pointer to the aggregate to the requesting object 60. The aggregate may be, for example, an array of pointers or a list of linked pointers, the aggregate being returned by returning the pointer to the head of the array or linked list.

【0025】この特定の実施例では要求元オブジェクト
であってかつ図2のアドレスブック・レコード46に対
応するモデル・オブジェクト60はユーザの要求に応答
してテーブル・オープン62の処理を実行し、この実行
はテーブル・オブジェクト63の1つのオブジェクトを
呼出して、内容取り出しメッセージをテーブル・オブジ
ェクト63に送る。
In this particular embodiment, the model object 60, which is the requesting object and corresponds to the address book record 46 of FIG. 2, performs the process of opening the table 62 in response to the user's request. Execution invokes one of the table objects 63 and sends a content fetch message to the table object 63.

【0026】その結果、テーブル・オブジェクト63は
インスタンス変数を含むデータ・オブジェクトを作成
し、これはインスタンス変数の割り当てのためにデータ
・アクセス・ルーチンに転送される。テーブル・オブジ
ェクト63によって作成されたデータ・オブジェクト
は、データ・アクセス・ルーチン(問合せオープン・ル
ーチン68、問合せ取り出しルーチン70およびコミッ
ト・ルーチン72)によってデータを検索してきた列と
同じ順序でインスタンス変数を含んでいる。テーブル・
オブジェクト63はトランスレータ・オブジェクト66
を呼出す内容取り出し64の処理を実行し、問合せオー
プン・メッセージを送り、データ・オブジェクトにパラ
メータまたはポインタを転送する。
As a result, table object 63 creates a data object containing the instance variables, which is transferred to the data access routine for instance variable assignment. The data object created by table object 63 contains instance variables in the same order as the columns from which data was retrieved by the data access routines (query open routine 68, query fetch routine 70, and commit routine 72). In. table·
Object 63 is a translator object 66
Performs the content retrieval 64 process, sends an inquiry open message, and transfers parameters or pointers to the data object.

【0027】トランスレータ・オブジェクト66は問合
せオープン74の処理を実行し、これはアプリケーショ
ン・プログラム・インターフェース(API)の呼び出し
を、データ・オブジェクトに対するパラメータまたはポ
インタと共に、問合せオープン・ルーチン68に送り、
結果として、問合せオープン・ルーチン68が構造化さ
れた問合せ言語データ領域(SQLDA)およびSQLDAポインタ
を設定する。このSQLDAは問合せオープン・ルーチン6
8にパラメータまたは開始ポインタを転送することによ
って設定される。このSQLDAは基本的にはデータをどこ
におくかを関係データベース80に知らせる。その後、
問合わせオープン・ルーチン68はSQLDAおよびSQLDAポ
インタが設定されたトランスレータ・オブジェクト66
にメッセージを送る。このメッセージはテーブル・オブ
ジェクト63に送られ、内容取り出し64の処理は問合
せ取り出しメッセージをトランスレータ・オブジェクト
66に送る。トランスレータ・オブジェクト66は問合
せ取り出し76の処理ルーチンを呼出して、APIの呼び
出しを問合せ取り出しルーチン70に送る。この問合せ
取り出しルーチン70はトランスレータ・オブジェクト
66によって作成されたデータ・オブジェクトに1行分
のデータを戻す。問合せ取り出しルーチン70はデータ
・オブジェクトのインスタンス変数と同じ順序のSQLDA
の列を通って繰り返されるのが好ましい。テーブル・オ
ブジェクト63は異なったタイプのデータまたは異なっ
た順序のデータを検索するための異なったテーブルを含
んでいる。各テーブルは特定のテーブルによって設定さ
れる順序で特定のデータを検索するために構成された一
組のデータ・アクセス・ルーチンを有している。
The translator object 66 performs a query open 74 operation, which sends an application program interface (API) call to the query open routine 68 with parameters or pointers to the data object.
As a result, the query open routine 68 sets up a structured query language data area (SQLDA) and SQLDA pointer. This SQLDA is a query open routine 6
8 by transferring a parameter or start pointer. This SQLDA basically tells the relational database 80 where to put the data. afterwards,
The open query routine 68 is a translator object 66 with an SQLDA and an SQLDA pointer set.
Send a message to This message is sent to the table object 63, and the process of the content fetch 64 sends a query fetch message to the translator object 66. The translator object 66 calls the query fetch 76 processing routine and sends an API call to the query fetch routine 70. The query retrieval routine 70 returns one row of data to the data object created by the translator object 66. The query fetch routine 70 uses an SQLDA in the same order as the data object instance variables.
Are preferably repeated. The table object 63 contains different tables for retrieving different types of data or different orders of data. Each table has a set of data access routines configured to retrieve specific data in the order set by the specific table.

【0028】データ・オブジェクトのインスタンス変数
が記入された後、データ・オブジェクトのポインタはデ
ータ・オブジェクトのポインタを含む集合体に付加され
る。内容取り出しルーチン64はループを循環し、その
ルーチンが検索されるべきデータが最早無くなったこと
を示すメッセージを受け取るまで、トランスレータ・オ
ブジェクト66を呼出す。問合せ取り出しルーチン76
が、検索されるべきデータ無しのメッセージをトランス
レータ・オブジェクト66に送った時、このメッセージ
はテーブル・オブジェクト63に送られる。
After the data object instance variables have been filled in, the data object pointer is added to the collection containing the data object pointer. The content fetching routine 64 cycles through the loop, calling the translator object 66 until the routine receives a message indicating that there is no more data to be retrieved. Query retrieval routine 76
Sends a message with no data to be retrieved to the translator object 66, this message is sent to the table object 63.

【0029】データ無しのメッセージに応答して、トラ
ンスレータ・オブジェクト66はコミット・メッセージ
をトランスレータ・オブジェクトに送り、その結果、コ
ミット78が実行されてコミット・ルーチン72にAPI
の呼び出しが送られ、これにより関係データベース80
が閉じられる。その後、トランスレータ・オブジェクト
66は関係データベース80が閉じられた旨のメッセー
ジを受け取り、テーブル・オブジェクト63にそのメッ
セージを転送する。最後に、モデル・オブジェクト60
に集合体のポインタを送ることによって、データ・オブ
ジェクトの集合体がモデル・オブジェクト60に送られ
る。
In response to the no data message, the translator object 66 sends a commit message to the translator object so that a commit 78 is executed and the commit routine 72
Is sent, which causes the relational database 80
Is closed. Thereafter, translator object 66 receives the message that relational database 80 has been closed and forwards the message to table object 63. Finally, the model object 60
The aggregate of data objects is sent to the model object 60 by sending the aggregate pointer to.

【0030】テーブル・オブジェクト63は複数のテー
ブルを有し、各テーブルはデータ・オブジェクト中にデ
ータを正しく配置するのに使用される一組のデータ・ア
クセスのルーチンを有している。例えば、モデル・オブ
ジェクト60が住所録であり、姓(ラスト・ネーム)、
名(ファースト・ネーム)および電話番号の順序でデー
タを要求した場合、テーブル・オブジェクト63はモデ
ル・オブジェクト60によって要求された順序で特定の
データを検索する一組のデータ・アクセスのルーチンを
呼び出すテーブルを呼出す。モデル・オブジェクト60
が名(ファースト・ネーム)、姓(ラスト・ネーム)お
よび電話番号の順序でデータを要求するならば、テーブ
ル・オブジェクト63は要求された順序でデータを検索
する第2の組のデータ・アクセス・ルーチンを呼出す第
2のテーブルを使用する。従って、検索されるデータま
たはデータの順序が変更される場合、テーブル・オブジ
ェクト63の異なったテーブルおよびデータ・アクセス
・ルーチンの異なった組が使用される。
The table object 63 has a plurality of tables, each table having a set of data access routines used to place data correctly in the data object. For example, the model object 60 is an address book, and the last name,
When requesting data in the order of first name and telephone number, table object 63 invokes a set of data access routines that retrieve specific data in the order requested by model object 60. Call. Model object 60
If requesting data in the order of first name, last name, and telephone number, table object 63 will retrieve a second set of data access data to retrieve the data in the requested order. Use a second table that calls the routine. Thus, if the data to be retrieved or the order of the data is changed, different tables of the table object 63 and different sets of data access routines are used.

【0031】本発明は上述した実施例に限定して解釈さ
れるべきではない。例えば、図3に示された実施例では
データ・オブジェクトへポインタを戻すことに加えて、
要求元オブジェクトにデータ・オブジェクトを戻す他の
方法も使用できる。更に、要求元オブジェクトがデータ
・オブジェクトを作成し記入することもでき、これによ
り、テーブル・オブジェクト63の必要性を除去する。
また、テーブル・オブジェクト63およびトランスレー
タ・オブジェクト66は本発明の下で1つのオブジェク
トに結合することができる。
The present invention should not be construed as being limited to the above-described embodiment. For example, in the embodiment shown in FIG. 3, in addition to returning a pointer to a data object,
Other methods of returning the data object to the requesting object can also be used. In addition, the requesting object can create and fill in data objects, thereby eliminating the need for table objects 63.
Also, the table object 63 and the translator object 66 can be combined into one object under the present invention.

【0032】データが配置されるべき位置にルーチンを
伝えるるデータ・アクセスのルーチンにパラメータを送
ることによって、検索されるデータの順序を変更するこ
とができるように、データ・アクセス・ルーチンに一層
の柔軟性を持たせることが可能である。例えば、データ
・アクセスルーチンは名(ファースト・ネーム)、性
(ラスト・ネーム)および電話番号を検索できる。ユー
ザは姓(ラスト・ネーム)、名(ファースト・ネーム)
および電話番号の順番でデータを有することを望んだ
り、または名(ファースト・ネーム)、姓(ラスト・ネ
ーム)および電話番号の順番でデータを有することを望
んだりする。データ・オブジェクトに配置されるデータ
の順序の変更はテーブル・オブジェクト63の各順序に
関するテーブルをそれぞれ有することによって達成され
る。データ・アクセスのルーチンにパラメータを転送す
ることによって、テーブル・オブジェクト63の1つの
テーブルは名(ファースト・ネーム)を最初に配置させ
る。テーブル・オブジェクト63の第2テーブルは異な
ったパラメータの組を送ることによって、姓(ラスト。
ネーム)をデータ・オブジェクトに最初に配置させる。
このようにして、もし名(ファースト・ネーム)、姓
(ラスト・ネーム)および電話番号の順序が望まれるな
らば、この特定の順序に関連したテーブルが呼出され
る。
The data access routine can be further reordered so that the order of the data retrieved can be changed by sending parameters to the data access routine which tells the routine where to place the data. It is possible to have flexibility. For example, the data access routine can retrieve the first name, gender (last name), and telephone number. User is surname (last name), first name (first name)
And wants to have the data in the order of telephone numbers, or wants to have the data in the order of first name, last name and telephone number. Changing the order of the data placed in the data object is achieved by having a table for each order of the table object 63, respectively. By transferring the parameters to the data access routine, one table in the table object 63 causes the first name to be placed first. The second table of the table object 63 sends a different set of parameters to allow the last name to be sent.
Name) is first placed in the data object.
Thus, if the order of first name, last name and telephone number is desired, the table associated with this particular order is called.

【0033】また、関係データベースのすべての列を検
索するデータ・アクセスのルーチンを使用することによ
って、より大きな柔軟性が達成される。どの列がデータ
・オブジェクトに配置されるべきか、そしてどんな順序
で選択された列がデータ・オブジェクトに配置されるべ
きかを指示するデータ・アクセスのルーチンへパラメー
タを転送することによって、テーブル・オブジェクト6
3の異なったテーブルと、関係データベースのための1
つのデータ・アクセス・ルーチンとを使用することによ
りデータおよび順番付けの種々の組み合せを作ることが
可能である。
Greater flexibility is also achieved by using a data access routine that retrieves all columns of the relational database. A table object by transferring parameters to a data access routine that indicates which columns should be placed in the data object and in what order the selected columns should be placed in the data object 6
3 different tables and 1 for relational database
By using one data access routine, various combinations of data and ordering can be made.

【0034】例えば、関係データベースが名前、電話番
号および住所を含んでいる場合を考えてみる。ある時に
は、ユーザは電話をかける必要上、名前と電話番号だけ
を検索したい場合がある。ある時には、ユーザは文書を
郵送するために、電話番号ではなく、名前および住所を
検索したい場合がある。何れの場合においても、どのデ
ータがどのような順序でデータ・オブジェクトに配置さ
れるべきかに関するルーチンに差し向けるために、テー
ブル・オブジェクト63のテーブルはデータ・アクセス
のルーチンへパラメータを転送するために使用される。
これはデータ・アクセスのルーチンの新しい組を作成さ
せる必要もなく、テーブル・オブジェクト63に、所望
の特定のフオーマットのテーブルを設定することによっ
てデータ検索のパーソナリゼーションを可能とする。し
たがって、特定の関係データベースのための単一のデー
タ・アクセスのルーチンは多数のユーザによって使用さ
れることができる。
For example, consider the case where the relational database contains names, telephone numbers and addresses. At some point, the user may need to make a call and only want to retrieve the name and phone number. At times, a user may want to search for a name and address, rather than a telephone number, to mail a document. In any case, the table of the table object 63 is used to transfer parameters to the data access routine in order to direct the routine as to what data should be placed in the data object and in what order. used.
This allows personalization of the data retrieval by setting the table object 63 to the desired specific format table without having to create a new set of data access routines. Thus, a single data access routine for a particular relational database can be used by multiple users.

【0035】上述の実施例では、データの読み取りを説
明したが、本発明はデータの修正、データの付加または
変更にも使用することができる。図3に示した実施例の
下でデータを修正するために、問合せ取り出しルーチン
76の処理はトランスレータ・オブジェクト66には必
要がなく、そして問合せオープン74の処理はどのデー
タを変更すべきか、またはどのデータを関係データベー
ス80に付加すべきかに関する情報を識別するために、
より多数のパラメータを含んでいる。
In the above-described embodiment, data reading is described. However, the present invention can also be used for correcting data, adding data, or changing data. In order to modify the data under the embodiment shown in FIG. 3, the processing of the query fetch routine 76 is not necessary for the translator object 66, and the processing of the query open 74 is to change which data or To identify information about whether data should be added to relational database 80,
Includes more parameters.

【0036】[0036]

【発明の効果】本発明はオブジェクト指向環境から出る
ことなく、オブジェクト指向環境外の関係データベース
にアクセスすることを可能にする。 そして、本発明で
は、複数種類のデータ・アクセス・ルーチン・テーブル
を記憶しておき、要求元オブジェクトから受け取ったデ
ータ・アクセス・メッセージに対応するデータを検索す
るためのデータ・アクセス・ルーチンを有するテーブル
を予め記憶された複数種類のテーブルから選択すること
により、例えば異なる順序でデータを配列する複数種類
の検索要求に対しても、高速に検索を行うことができ
る。
The invention makes it possible to access relational databases outside the object-oriented environment without leaving the object-oriented environment. In the present invention, a plurality of types of data access routine tables are stored, and a table having a data access routine for retrieving data corresponding to the data access message received from the requesting object is stored. Is selected from a plurality of types of tables stored in advance, a high-speed search can be performed even for a plurality of types of search requests in which data is arranged in different orders, for example.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明の方法を実施するのに使用される分散デ
ータ処理システムを示す図である。
FIG. 1 illustrates a distributed data processing system used to implement the method of the present invention.

【図2】本発明の方法に従って関係データベースからデ
ータを検索する方法を説明するための図である。
FIG. 2 is a diagram for explaining a method of retrieving data from a relational database according to the method of the present invention.

【図3】Smalltalk V/PMの言語で書かれた関係データベ
ースからデータを検索するためのブロック図である。
FIG. 3 is a block diagram for retrieving data from a relational database written in the language of Smalltalk V / PM.

【符号の説明】[Explanation of symbols]

8 データ処理システム 10、32 ローカル・エリア・ネットワーク 12、30 コンピユータ 14、20 記憶装置 16 プリンタ 18 メインフレーム・コンピユータ 24、34 通信リンク 26 サブシステム制御ユニット/通信コントローラ 28 ゲートウェイ・サーバー 40 アドレスブック・ウインドゥ 42 エントリ・アイコン 46 アドレスブック・レコード 48、80 関係データベース 50 インターフェース 52 アドレスブックレコード・ウインドゥ 60 要求元オブジェクト 62 テーブル・オープン 63 テーブル・オブジェクト 64 内容取り出しルーチン 66 トランスレータ・オブジェクト 68 問合せオープン・ルーチン 70 問合せ取り出しルーチン 72 コミット・ルーチン 8 Data Processing System 10, 32 Local Area Network 12, 30 Computer 14, 20 Storage 16 Printer 18 Mainframe Computer 24, 34 Communication Link 26 Subsystem Control Unit / Communication Controller 28 Gateway Server 40 Address Book Window 42 Entry Icon 46 Address Book Record 48, 80 Relational Database 50 Interface 52 Address Book Record Window 60 Requester Object 62 Table Open 63 Table Object 64 Contents Retrieval Routine 66 Translator Object 68 Query Open Routine 70 Query Retrieval Routine 72 Commit Routine

───────────────────────────────────────────────────── フロントページの続き (72)発明者 キャシー・ジェー・カベンディッシュ アメリカ合衆国テキサス州ダラス、ラ・ ベルドラ・ドライブ 7715番地 (72)発明者 ケビン・エル・サイツェ アメリカ合衆国ニユー・メキシコ州、ラ ス・クルーセス、グレディス・ドライ ブ、ナンバー15 1625番地 (56)参考文献 米国特許4930071(US,A) Communications of the ACM Vol.33,No. 11(1990−11)P.99−109 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Kathy J. Cavendish, 7715 La Verdra Drive, Dallas, Texas, USA Cruces, Gladys Drive, number 15 1625 (56) Reference US Patent 4930071 (US, A) Communications of the ACM Vol. 33, No. 11 (1990-11) p. 99-109

Claims (2)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】ポインタによりデータ構造が指し示される
オブジェクト指向環境内にある要求元オブジェクトから
のデータ・アクセス・メッセージに応答してオブジェク
ト指向環境外にある関係データベースにアクセスするデ
ータ処理装置であって、 複数種類のデータ・アクセス・ルーチン・テーブルを記
憶する記憶手段と、 前記要求元オブジェクトからデータ・アクセス・メッセ
ージを受取る受信手段と、 前記データ・アクセス・メッセージに対応するデータを
検索するためのデータ・アクセス・ルーチンを有するテ
ーブルを前記記憶手段に記憶された複数種類のテーブル
から選択する選択手段と、 データを保持するためオブジェクト指向環境内でインス
タンス変数を含むデータ・オブジェクトを作成する作成
手段と、 前記選択されたテーブルに対応し前記関係データベース
をアクセスするためのデータ・アクセス・ルーチンにコ
マンドを送信する送信手段と、 前記データ・アクセス・ルーチンから前記関係データベ
ースへのアクセスの結果を受信する受信手段と、 アクセスの結果をデータ・オブジェクト内に配置する配
置手段と、 データ・オブジェクトに対するポインタを要求元オブジ
ェクトに送信する送信手段と、 よりなる関係データベースにアクセスするデータ処理装
置。
1. A data processing apparatus for accessing a relational database outside an object-oriented environment in response to a data access message from a request source object in an object-oriented environment whose data structure is pointed to by a pointer. Storage means for storing a plurality of types of data access routine tables; receiving means for receiving a data access message from the request source object; and data for retrieving data corresponding to the data access message. Selecting means for selecting a table having an access routine from a plurality of types of tables stored in the storage means; creating means for creating a data object including instance variables in an object-oriented environment for holding data; The selected text Transmitting means for transmitting a command to a data access routine for accessing the relational database corresponding to the table, receiving means for receiving a result of access to the relational database from the data access routine, A data processing apparatus for accessing a relational database, comprising: arranging means for arranging a result in a data object; and transmitting means for transmitting a pointer to the data object to a requesting object.
【請求項2】ポインタによりデータ構造が指し示される
オブジェクト指向環境内にある要求元オブジェクトから
のデータ・アクセス・メッセージに応答してオブジェク
ト指向環境外にある関係データベースにアクセスする方
法であって、 複数種類のデータ・アクセス・ルーチン・テーブルを記
憶する段階と、 前記要求元オブジェクトからデータ・アクセス・メッセ
ージを受取る段階と、 前記データ・アクセス・メッセージに対応するデータを
検索するためのデータ・アクセス・ルーチンを有するテ
ーブルを前記複数種類のテーブルから選択する段階と、 データを保持するためオブジェクト指向環境内でインス
タンス変数を含むデータ・オブジェクトを作成する段階
と、 前記選択されたテーブルに対応し前記関係データベース
をアクセスするためのデータ・アクセス・ルーチンにコ
マンドを送信する段階と、 前記データ・アクセスルーチンから前記関係データベー
スへのアクセスの結果を受信する段階と、 アクセスの結果をデータ・オブジェクト内に配置する段
階と、 データ・オブジェクトに対するポインタを要求元オブジ
ェクトに送信する段階と、 よりなる関係データベースにアクセスする方法。
2. A method for accessing a relational database outside an object-oriented environment in response to a data access message from a requesting object within the object-oriented environment pointed to by a pointer to a data structure, the method comprising: Storing a data access routine table of a type; receiving a data access message from the requesting object; and a data access routine for retrieving data corresponding to the data access message. Selecting a table having the following from the plurality of types of tables: creating a data object including instance variables in an object-oriented environment for retaining data; and storing the relational database corresponding to the selected table. Access Sending a command to a data access routine for receiving a result of the access to the relational database from the data access routine; placing the result of the access in a data object; Sending a pointer to the object to the requesting object; and accessing the relational database.
JP4020745A 1991-03-12 1992-01-10 Data processing apparatus and method for accessing relational database Expired - Lifetime JP2767767B2 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US68800191A 1991-03-12 1991-03-12
US688001 2000-10-14

Publications (2)

Publication Number Publication Date
JPH0561746A JPH0561746A (en) 1993-03-12
JP2767767B2 true JP2767767B2 (en) 1998-06-18

Family

ID=24762711

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4020745A Expired - Lifetime JP2767767B2 (en) 1991-03-12 1992-01-10 Data processing apparatus and method for accessing relational database

Country Status (1)

Country Link
JP (1) JP2767767B2 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6122627A (en) * 1997-05-09 2000-09-19 International Business Machines Corporation System, method, and program for object building in queries over object views
EP1424497A4 (en) 2001-09-03 2010-02-24 Panasonic Corp Fan device, method of manufacturing the fan device, projection type display device, and electronic equipment
JP2008233472A (en) 2007-03-20 2008-10-02 Canon Inc Projection type display device

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4930071A (en) 1987-06-19 1990-05-29 Intellicorp, Inc. Method for integrating a knowledge-based system with an arbitrary database system

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4930071A (en) 1987-06-19 1990-05-29 Intellicorp, Inc. Method for integrating a knowledge-based system with an arbitrary database system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Communications of the ACM Vol.33,No.11(1990−11)P.99−109

Also Published As

Publication number Publication date
JPH0561746A (en) 1993-03-12

Similar Documents

Publication Publication Date Title
US5212787A (en) Method and apparatus for accessing a relational database without exiting an object-oriented environment
US7555488B2 (en) Prefetching and caching persistent objects
US7269664B2 (en) Network portal system and methods
US6353830B1 (en) Graphical interface for object-relational query builder
US6606627B1 (en) Techniques for managing resources for multiple exclusive groups
US6587854B1 (en) Virtually partitioning user data in a database system
US6804671B1 (en) Pluggable tablespaces for database systems
US6738775B2 (en) Database communication system and method for communicating with a database
US6741982B2 (en) System and method for retrieving data from a database system
US5124909A (en) Software program for providing cooperative processing between personal computers and a host computer
US6910052B2 (en) Distributing and synchronizing objects
US5956733A (en) Network archiver system and storage medium storing program to construct network archiver system
US7587400B2 (en) Suspending a result set and continuing from a suspended result set for transparent session migration
US5224212A (en) Asynchronous operation in a database management system
US6356946B1 (en) System and method for serializing Java objects in a tubular data stream
US5787413A (en) C++ classes for a digital library
US6763347B1 (en) Indexing management for hierarchical main memory
JPH07175704A (en) File device and method for access to data object
US6549901B1 (en) Using transportable tablespaces for hosting data of multiple users
US5657447A (en) Platform-transparent registration and build of stored procedures and user-defined functions
US20030071854A1 (en) Multi-repository display system using separate presentation, adaptation and access layers
JP2001101042A (en) System and method for managing data
JP3756407B2 (en) Method for handling user-defined data type data items
JP2767767B2 (en) Data processing apparatus and method for accessing relational database
US20050080759A1 (en) Transparent interface to a messaging system from a database engine

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090410

Year of fee payment: 11

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100410

Year of fee payment: 12

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110410

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110410

Year of fee payment: 13

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120410

Year of fee payment: 14

EXPY Cancellation because of completion of term
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120410

Year of fee payment: 14