H2: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 13: Line 13:


* [[H2 Data Types]]
* [[H2 Data Types]]
==H2 URLs==
Remote:
jdbc:h2:tcp://{host::localhost}[:{port::9092}]/{database::default}[;<;,user={user:param},password={password:param},{:identifier}={:param}>]
In-memory:
jdbc:h2:mem:{database::default}?[;<;,{:identifier}={:param}>]
Embedded:
jdbc:h2:!(tcp://)[file:]{path}[;<;,user={user:param},password={password:param},{:identifier}={:param}>]


=Installation=
=Installation=

Revision as of 05:37, 19 October 2018

External

Internal

Overview

Concepts

H2 URLs

Remote:

jdbc:h2:tcp://{host::localhost}[:{port::9092}]/{database::default}[;<;,user={user:param},password={password:param},{:identifier}={:param}>]

In-memory:

jdbc:h2:mem:{database::default}?[;<;,{:identifier}={:param}>]

Embedded:

jdbc:h2:!(tcp://)[file:]{path}[;<;,user={user:param},password={password:param},{:identifier}={:param}>]

Installation

cd $RUNTIME_DIR
unzip .../h2-2017-06-10.zip
mv h2 h2-2017-06-10
ln -s ./h2-2017-06-10 h2

Operations

Run Database and H2 Console

cd $RUNTIME_DIR/h2/bin
./h2.sh

This will start a "test" database and make H2 console available on port 8082: http://localhost:8082

The "test" database will be available as "jdbc:h2:tcp://localhost/~/test", authenticating with a "sa" user and an empty password ("").

H2 DDL Operations

H2 DDL Operations

H2 DML Operations

H2 DML Operations