クイックスタート
アプリケーションのエンベッドH2H2 コンソール アプリケーション
アプリケーションのエンベッドH2
このデータベースはエンベッドモード、またはサーバーモードで使用可能です。エンベッドモードで使用する場合、以下を行う必要があります:
- Add the
h2*.jarto the classpath (H2 does not have any dependencies) - JDBCドライバークラスを使用する:
org.h2.Driver - データベースURL
jdbc:h2:~/testユーザーホームディレクトリ内の "test" でデータベースを開く - A new database is automatically created
H2 コンソール アプリケーション
このコンソールはブラウザインターフェースを使ってSQL データベースにアクセスします。
Windows XPをご使用でなかったり、期待通りに機能しない場合は、チュートリアル内の詳細説明をご覧下さい。
手順
インストール
Windows インストーラーを使用してソフトウェアをインストールしましょう (まだインストールされていない場合)。
コンソールを起動する
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:

コンソールウィンドウが 開きます:

Also, a new browser page should open with the URL http://localhost:8082 . You may get a security warning from the firewall. If you don't want other computers in the network to access the database on your machine, you can let the firewall block these connections. Only local connections are required at this time.
ログイン
Select [Generic H2] and click [Connect]:

ログインされました。
サンプル
Click on the [Sample SQL Script]:

SQLコマンドがコマンドエリアに表示されます。
実行する
Click [Run]

左側のデータベースアイコンの下に、 新しいテーブル TEST が追加されます。動作とステートメントの結果は、スクリプトの下に表示されます。

切断
Click on [Disconnect]:
![]()
to close the connection.
終了
コンソールウィンドウを閉じます。詳細はチュートリアルをご覧下さい。