ApplixWare

設定

ApplixWare must be configured correctly in order for it to be able to access the Postgres ODBC software drivers.

ApplixWareを正しく設定してやれば、 そこから PostgreSQLODBC ソフトウェアドライバにアクセスすることができるようになります。

ApplixWareによるデータベースアクセスを有効にする

These instructions are for the 4.4.1 release of ApplixWare on Linux. Refer to the Linux Sys Admin on-line book for more detailed information.

この説明は LinuxApplixWare 4.4.1リリースの為の物です。 さらに多くの詳細情報は Linux Sys Admin オンラインブックを参照してください。

  1. You must modify axnet.cnf so that elfodbc can find libodbc.so (the ODBC driver manager) shared library. This library is included with the ApplixWare distribution, but axnet.cnf needs to be modified to point to the correct location.

    elfodbclibodbc.so ODBC ドライバマネージャー)が共用ライブラリを 発見することができるように、 axnet.cnf を修正しなくてはなりません。 このライブラリは ApplixWare に含まれていますが、 axnet.cnf が正しい位置を指し示すように 修正する必要があります。

    As root, edit the file applixroot/applix/axdata/axnet.cnf.

    root権限で、applixroot/applix/axdata/axnet.cnf というファイルを編集します。

    1. At the bottom of axnet.cnf, find the line that starts with

      まず、axnet.cnf の中に有る、以下で始まる一行を探します。

      #libFor elfodbc /ax/...

    2. Change line to read

      それを以下のように変更して下さい(訳注:行頭の#を外す)。

      libFor elfodbc applixroot/applix/axdata/axshlib/lib
      which will tell elfodbc to look in this directory for the ODBC support library. If you have installed applix somewhere else, change the path accordingly. これは elfodbc に対し、指定したディレクトリで ODBC サポートライブラリを探すように指示します。 もしどこか他の場所に ApplixWare をインストールした場合は、 それに合わせてApplixWareのルートパスを変更してください。

  2. Create .odbc.ini as described above. You may also want to add the flag

    前述したような.odbc.iniを作ってください。 テキストフィールドに**BLOB**が表示されない ように、.odbc.iniのデータベース固有セクションに、 以下のようなフラグを追加することもできます。

    TextAsLongVarchar=0
    to the database-specific portion of .odbc.ini so that text fields will not be shown as **BLOB**.

ApplixWare での ODBC 接続テスト

  1. Bring up Applix Data

    Applix Data を起動します。

  2. Select the Postgres database of interest.

    使用したい PostgreSQL データベースを選びます。

    1. Select Query->Choose Server.

      検索 -> サーバ選択 を選びます。

    2. Select ODBC, and click Browse. The database you configured in .odbc.ini should be shown. Make sure that the Host: field is empty (if it is not, axnet will try to contact axnet on another machine to look for the database).

      ODBC のタブをクリックし、 一覧 ボタンをクリックします。 .odbc.ini で設定したデータベースが見えるはずです。 ホスト:表示フィールド が空欄である事を確認してください (もし空欄になっていない場合は、 axnet がデータベースを探そうと他のホスト上にある axnet と通信しようとしています)。

    3. Select the database in the box that was launched by Browse, then click OK.

      一覧ボタンで起動された選択ボックスからデータ ベースを選び、了解ボタンをクリックします。

    4. Enter username and password in the login identification dialog, and click OK.

      ユーザ名とパスワードを ユーザー定義ダイアログ に入力し、 了解ボタンをクリックします。

    You should see "Starting elfodbc server" in the lower left corner of the data window. If you get an error dialog box, see the debugging section below.

    データウインドウの左下隅に "Starting elfodbc server"という メッセージが表示されます。もしエラーを表示するダイアログボックスが出たら、 後述のデバッグセクションを参照してください。

  3. The 'Ready' message will appear in the lower left corner of the data window. This indicates that you can now enter queries.

    '準備完了' というメッセージが、画面左下隅に現われます。 これは問い合わせ行うことが出来るようになった事を示しています。

  4. Select a table from Query->Choose tables, and then select Query->Query to access the database. The first 50 or so rows from the table should appear.

    検索 -> テーブルの選択 を実行し接続先のテーブルを選び、 次に 検索 -> 検索 と選んで、データベースにアクセスして みてください。そのテーブルの50行程度が表示されるはずです。

よくある問題

The following messages can appear while trying to make an ODBC connection through Applix Data:

以下のメッセージは、Applix Data を通して ODBC 接続を行おうとする場合、 表示されることがあります:

Cannot launch gateway on server

elfodbc can't find libodbc.so. Check your axnet.cnf.

elfodbc が libodbc.so ファイルを見つけることが出来ません。 この場合、axnet.cnf ファイルを確認し ください。

ODBC ゲートウエイからのエラー: IM003::[iODBC][Driver Manager]Specified driver could not be loaded

libodbc.so cannot find the driver listed in .odbc.ini. Verify the settings.

.odbc.ini にリストアップされた libodbc.so ドライバを見つけることが できません。設定を確かめてください。

Server: Broken Pipe

The driver process has terminated due to some other problem. You might not have an up-to-date version of the Postgres ODBC package.

そのドライバプロセスは何か他の問題のために終了してしまいました。 あなたは 最新バージョンの PostgreSQL ODBC パッケージを持っていないのかも知れません。

setuid to 256: failed to launch gateway

The September release of ApplixWare v4.4.1 (the first release with official ODBC support under Linux) shows problems when usernames exceed eight (8) characters in length. Problem description ontributed by Steve Campbell.

9月にリリースされた ApplixWare v4.4.1 ( Linux用として ODBC のサポートをした最初の公式リリース) は、ユーザ名が8文字を超える場合、いくつかの問題が発生します。 この問題の解説を Steve Campbell が寄稿してくれました。

著者: Contributed by Steve Campbell on 1998-10-20.

Steve Campbell が1998-10-20に寄稿。

The axnet program's security system seems a little suspect. axnet does things on behalf of the user and on a true multiple user system it really should be run with root security (so it can read/write in each user's directory). I would hesitate to recommend this, however, since we have no idea what security holes this creates. axnet プログラムのセキュリティシステム は少し疑わしい。 axnet はユーザの代理 として動作するので、真のマルチユーザシステム上ではそれはまさ ルートセキュリティ(つまり、それは全ユーザのディレクトリ を読み書き可能)で動作してしまう。 しかしながら、我々はこれが何かしらのセキュリティホールを作るか どうかはっきりしないので、使用を薦めることをためらってしまう。

ApplixWare ODBC 接続のデバッギング

One good tool for debugging connection problems uses the Unix system utility strace.

UNIX システムユーティリティーの strace は、接続に関する問題をデバッグするための良いツールの一つです。

strace を使ったデバッグ

  1. Start applixware.

    ApplixWare を起動します。

  2. Start an strace on the axnet process. For example, if

    axnet プロセスに対し、 strace を実行します。 例えば、もし以下のコマンドを実行した時、

    ps -aucx | grep ax 
    shows 次のように表示された場合は、
    cary   10432  0.0  2.6  1740   392  ?  S  Oct  9  0:00 axnet
    cary   27883  0.9 31.0 12692  4596  ?  S   10:24  0:04 axmain

    Then run

    strace をこのように実行します。

       strace -f -s 1024 -p 10432 

  3. Check the strace output.

    strace の出力を確認します。

    Cary からの情報: Many of the error messages from ApplixWare go to stderr, but I'm not sure where stderr is sent, so strace is the way to find out.

    ApplixWare からのエラーメッセージの 多くは 標準エラー出力に出力されますが、 しかしどこに 標準エラー出力が送られるか 定かでないので、それで strace コマンドを問題解決の手段としています。

For example, after getting a "Cannot launch gateway on server", I ran strace on axnet and got

例えば、"Cannot launch gateway on server" という エラー発生時、私は axnet に対し strace を起動し、以下の情報を 得ることが出来ました:

[pid 27947] open("/usr/lib/libodbc.so", O_RDONLY) = -1 ENOENT
    (No such file or directory)
[pid 27947] open("/lib/libodbc.so", O_RDONLY) = -1 ENOENT
    (No such file or directory)
[pid 27947] write(2, "/usr2/applix/axdata/elfodbc:
    can't load library 'libodbc.so'\n", 61) = -1 EIO (I/O error)
So what is happening is that applix elfodbc is searching for libodbc.so, but it can't find it. That is why axnet.cnf needed to be changed. 上記は、applix elfodbc が libodbc.so を捜したが、見つからなかったという状態を示していますが、これが、何故 axnet.cnf を変更する必要があったかという理由です。

ApplixWare デモの実行

In order to go through the ApplixWare Data Tutorial, you need to create the sample tables that the Tutorial refers to. The ELF Macro used to create the tables tries to use a NULL condition on many of the database columns, and Postgres does not currently allow this option.

ApplixWare Data チュートリアル を完全に 実行するためには、チュートリアルが参照するサンプルテーブル を作る必要があります。このテーブルを作るために使ったELF マクロ はデータベースコラムの多くをNULLの状態にしますが、 PostgreSQL は現在このオプションを 許可していません。

To get around this problem, you can do the following:

以下のようにすれば、この問題を回避することができます:

ApplixWare デモの修正

  1. Copy /opt/applix/axdata/eng/Demos/sqldemo.am to a local directory.

    /opt/applix/axdata/eng/Demos/sqldemo.am をローカルディレクトリにコピーします。

  2. Edit this local copy of sqldemo.am:

    コピーした sqldemo.am を編集します:

    1. Search for 'null_clause = "NULL"

      null_clause = "NULL" という行を探します。

    2. Change this to null_clause = ""

      これを null_clause = "" に変更します。

  3. Start Applix Macro Editor.

    マクロエディタを起動します。

  4. Open the sqldemo.am file from the Macro Editor.

    マクロエディタで sqldemo.am ファイルを開きます。

  5. Select File->Compile and Save.

    ファイル -> コンパイルと保存を選択します。

  6. Exit Macro Editor.

    マクロエディタ を終了します。

  7. Start Applix Data.

    Applix Data を起動します。

  8. Select *->Run Macro

    * -> マクロ実行 コマンドを選びます。

  9. Enter the value "sqldemo", then click OK.

    マクロ名ウインドに "sqldemo" と入力し、 了解ボタンをクリックします。

    You should see the progress in the status line of the data window (in the lower left corner).

    Applix Data 画面左下にあるステータスラインで進行状況を 見ることができます。

  10. You should now be able to access the demo tables.

    以上で、デモテーブルにアクセスできるはずです。

便利なマクロ

You can add information about your database login and password to the standard Applix startup macro file. This is an example ~/axhome/macros/login.am file:

標準の Applix 起動マクロファイルに、データベースログイン名とパスワードの情報を加えることができます。 以下は ~/axhome/macros/login.am ファイルの一例です:

macro login
    set_set_system_var@("sql_username@","tgl")
    set_system_var@("sql_passwd@","no$way")
endmacro

Caution

You should be careful about the file protections on any file containing username and password information.

ユーザ名とパスワード情報を含んでいる如何なるファイルも、その保護は注意深く行うこと。

サポート済みプラットホーム

psqlODBC has been built and tested on Linux. There have been reports of success with FreeBSD and with Solaris. There are no known restrictions on the basic code for other platforms which already support Postgres.

psqlODBC は、Linux 上で構築とテストが行われました。 FreeBSD とSolaris で成功したという報告があります。 PostgreSQL を既にサポートしている他のプラットホームでのベースコードについて既知の制限はありません。