組み込みデータベースは,Developerが提供するコマンドとHiRDB SQL Executerを使用して構築します。また,構築した組み込みデータベースを操作するには,HiRDB SQL Executerを使用します。
組み込みデータベースの構築および実装の流れを次に示します。
この節では,HiRDB SQL Executerを使用した組み込みデータベースの構築の手順を説明します。
なお,構築した組み込みデータベースを削除する場合は,「(3) 組み込みデータベースの削除」を参照してください。また,構築した組み込みデータベースの開始および停止の手順については,「6.2 組み込みデータベースの開始および停止」を参照してください。
組み込みデータベースの構築方法には,次の二つがあります。
それぞれの場合に分けて,組み込みデータベースの構築方法を説明します。
なお,組み込みデータベースを利用して,データベースにアクセスするJ2EEアプリケーションを開発する場合,ここで示す手順のほかに,次のマニュアルを参照してください。
データベースを構築したあとに,ユーザ定義およびテーブル定義を行う場合の手順を次に示します。
@rem Environment settings file used by HiRDB Embedded Server @rem Please do not use double quotation marks (") in the file path of this file. @rem Table owner's authorization identifier set USRID= @rem Table owner's password set PSWD= @rem Area size of the database to be constructed (required) set DB_SIZE=S @rem Directories where the RD area and system files are to be created (required) set RDAREA_DIR=C:¥Program Files¥Hitachi¥Cosminexus¥ADP¥EmbeddedDB¥area @rem TCP/IP port number used by HiRDB Embedded Server set DB_PORT=22200 @rem Directory where the input files used for HiRDB Embedded Server execution exist set INPUT_FILE_DIR=C:¥Setup_Input¥DB |
cddbconstruct.bat |
GRANT DBA TO USER1 IDENTIFIED BY PSWD; |
CREATE SCHEMA; |
ユーザ定義およびテーブル定義を行ったあとに,データベースを構築する場合の手順を次に示します。
@rem Environment settings file used by HiRDB Embedded Server @rem Please do not use double quotation marks (") in the file path of this file. @rem Table owner's authorization identifier set USRID=USER1 @rem Table owner's password set PSWD=PSWD @rem Area size of the database to be constructed (required) set DB_SIZE=S @rem Directories where the RD area and system files are to be created (required) set RDAREA_DIR=C:¥Program Files¥Hitachi¥Cosminexus¥ADP¥EmbeddedDB¥area @rem TCP/IP port number used by HiRDB Embedded Server set DB_PORT=22200 @rem Directory where the input files used for HiRDB Embedded Server execution exist set INPUT_FILE_DIR=C:¥Setup_Input¥DB |
cddbconstruct.bat |
ここでは,次に示す組み込みデータベース用の設定ファイル(cdsetupconfig.bat)の設定項目について説明します。
@rem ALL RIGHTS RESERVED, COPYRIGHT (C) 2004, HITACHI, LTD. @rem LICENSED MATERIAL OF HITACHI, LTD. @title HiRDB Embedded Server @echo off @rem Environment settings file used by HiRDB Embedded Server @rem Please do not use double quotation marks (") in the file path of this file. @rem Table owner's authorization identifier set USRID=USER1 ・・・(1) @rem Table owner's password set PSWD=PSWD ・・・(2) @rem Area size of the database to be constructed (required) set DB_SIZE=S ・・・(3) @rem Directories where the RD area and system files are to be created (required) set RDAREA_DIR=C:¥Program Files¥Hitachi¥Cosminexus¥ADP¥EmbeddedDB¥area ・・・(4) @rem TCP/IP port number used by HiRDB Embedded Server set DB_PORT=22200 ・・・(5) @rem Directory where the input files used for HiRDB Embedded Server execution exist set INPUT_FILE_DIR=C:¥Program Files¥Hitachi¥Cosminexus¥ADP¥EmbeddedDB¥ ・・・(6) |
設定ファイルに記述を追加するときは,次の点に注意してください。
(1)~(6)の各設定項目について説明します。
RDAREA_DIR=rdarea_directory[,systemA_directory[,systemB_directory]]
ひな型として提供されているディレクトリ,任意に作成するディレクトリ,および指定省略時に読み込まれるディレクトリ構成を次の図に示します。
図B-2 組み込みデータベースの入力ファイルのディレクトリ構成
組み込みデータベースは,次に示すバッチファイルを実行して削除します。
cddbdelete.bat |
エラーとなった場合は,バッチファイルを実行したプロンプト上に,構築に失敗したというメッセージが表示されます。この場合,pdirst_err.txtを参照してエラーの原因を取り除き,再度cddbdelete.batを実行してください。