ApplixWare must be configured correctly in order for it to be able to access the Postgres ODBC software drivers.
ApplixWareを正しく設定してやれば、 そこから PostgreSQL の ODBC ソフトウェアドライバにアクセスすることができるようになります。
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.
この説明は Linux 用 ApplixWare 4.4.1リリースの為の物です。 さらに多くの詳細情報は Linux Sys Admin オンラインブックを参照してください。
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.
elfodbc が libodbc.so ( ODBC ドライバマネージャー)が共用ライブラリを 発見することができるように、 axnet.cnf を修正しなくてはなりません。 このライブラリは ApplixWare に含まれていますが、 axnet.cnf が正しい位置を指し示すように 修正する必要があります。
As root, edit the file applixroot/applix/axdata/axnet.cnf.
root権限で、applixroot/applix/axdata/axnet.cnf というファイルを編集します。
At the bottom of axnet.cnf, find the line that starts with
まず、axnet.cnf の中に有る、以下で始まる一行を探します。
#libFor elfodbc /ax/...
Change line to read
それを以下のように変更して下さい(訳注:行頭の#を外す)。
libFor elfodbc applixroot/applix/axdata/axshlib/libwhich 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のルートパスを変更してください。
Create .odbc.ini as described above. You may also want to add the flag
前述したような.odbc.iniを作ってください。 テキストフィールドに**BLOB**が表示されない ように、.odbc.iniのデータベース固有セクションに、 以下のようなフラグを追加することもできます。
TextAsLongVarchar=0to the database-specific portion of .odbc.ini so that text fields will not be shown as **BLOB**.
ApplixWare での ODBC 接続テスト
Bring up Applix Data
Applix Data を起動します。
Select the Postgres database of interest.
使用したい PostgreSQL データベースを選びます。
Select Query->Choose Server.
検索 -> サーバ選択 を選びます。
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 と通信しようとしています)。
Select the database in the box that was launched by Browse, then click OK.
一覧ボタンで起動された選択ボックスからデータ ベースを選び、了解ボタンをクリックします。
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"という メッセージが表示されます。もしエラーを表示するダイアログボックスが出たら、 後述のデバッグセクションを参照してください。
The 'Ready' message will appear in the lower left corner of the data window. This indicates that you can now enter queries.
'準備完了' というメッセージが、画面左下隅に現われます。 これは問い合わせ行うことが出来るようになった事を示しています。
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 接続を行おうとする場合、 表示されることがあります:
elfodbc can't find libodbc.so. Check your axnet.cnf.
elfodbc が libodbc.so ファイルを見つけることが出来ません。 この場合、axnet.cnf ファイルを確認し ください。
libodbc.so cannot find the driver listed in .odbc.ini. Verify the settings.
.odbc.ini にリストアップされた libodbc.so ドライバを見つけることが できません。設定を確かめてください。
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 パッケージを持っていないのかも知れません。
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に寄稿。
One good tool for debugging connection problems uses the Unix system utility strace.
UNIX システムユーティリティーの strace は、接続に関する問題をデバッグするための良いツールの一つです。
strace を使ったデバッグ
Start applixware.
ApplixWare を起動します。
Start an strace on the axnet process. For example, if
axnet プロセスに対し、 strace を実行します。 例えば、もし以下のコマンドを実行した時、
ps -aucx | grep axshows 次のように表示された場合は、
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
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 を変更する必要があったかという理由です。
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 デモの修正
Copy /opt/applix/axdata/eng/Demos/sqldemo.am to a local directory.
/opt/applix/axdata/eng/Demos/sqldemo.am をローカルディレクトリにコピーします。
Edit this local copy of sqldemo.am:
コピーした sqldemo.am を編集します:
Search for 'null_clause = "NULL"
null_clause = "NULL" という行を探します。
Change this to null_clause = ""
これを null_clause = "" に変更します。
Start Applix Macro Editor.
マクロエディタを起動します。
Open the sqldemo.am file from the Macro Editor.
マクロエディタで sqldemo.am ファイルを開きます。
Select File->Compile and Save.
ファイル -> コンパイルと保存を選択します。
Exit Macro Editor.
マクロエディタ を終了します。
Start Applix Data.
Applix Data を起動します。
Select *->Run Macro
* -> マクロ実行 コマンドを選びます。
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 画面左下にあるステータスラインで進行状況を 見ることができます。
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 を既にサポートしている他のプラットホームでのベースコードについて既知の制限はありません。