quickstart.html 3.8 KB
Newer Older
1 2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
3
Copyright 2004-2018 H2 Group. Multiple-Licensed under the MPL 2.0, Version 1.0,
4 5 6 7
and under the Eclipse Public License, Version 1.0
Initial Developer: H2 Group
-->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
8 9
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
Thomas Mueller's avatar
Thomas Mueller committed
10
<meta name="viewport" content="width=device-width, initial-scale=1" />
11
<title>
12
Quickstart
13 14
</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" />
15 16 17 18 19 20 21 22 23 24 25 26
<!-- [search] { -->
<script type="text/javascript" src="navigation.js"></script>
</head><body onload="frameMe();">
<table class="content"><tr class="content"><td class="content"><div class="contentDiv">
<!-- } -->

<h1>Quickstart</h1>
<a href="#embedding">
    Embedding H2 in an Application</a><br />
<a href="#h2_console">
    The H2 Console Application</a><br />

Thomas Mueller's avatar
Thomas Mueller committed
27
<h2 id="embedding">Embedding H2 in an Application</h2>
28 29 30 31
<p>
This database can be used in embedded mode, or in server mode. To use it in embedded mode, you need to:
</p>
<ul>
32 33 34
<li>Add the <code>h2*.jar</code> to the classpath (H2 does not have any dependencies)
</li><li>Use the JDBC driver class: <code>org.h2.Driver</code>
</li><li>The database URL <code>jdbc:h2:~/test</code> opens the database <code>test</code> in your user home directory
35
</li><li>A new database is automatically created
36 37
</li></ul>

Thomas Mueller's avatar
Thomas Mueller committed
38
<h2 id="h2_console">The H2 Console Application</h2>
39 40 41
<p>
The Console lets you access a SQL database using a browser interface.
<br />
42 43 44
<img src="images/console-2.png"
    width="535" height="179"
    alt="Web Browser - H2 Console Server - H2 Database" />
45 46 47 48 49 50 51 52 53 54 55 56 57 58
<br />
If you don't have Windows XP, or if something does not work as expected,
please see the detailed description in the <a href="tutorial.html">Tutorial</a>.
</p>

<h3>Step-by-Step</h3>

<h4>Installation</h4>
<p>
Install the software using the Windows Installer (if you did not yet do that).
</p>

<h4>Start the Console</h4>
<p>
59
Click [Start], [All Programs], [H2], and [H2 Console (Command Line)]:<br />
Thomas Mueller's avatar
Thomas Mueller committed
60
<img class="screenshot" src="images/quickstart-1.png" alt="Screenshot: start H2 Console" /><br />
61
A new console window appears:<br />
Thomas Mueller's avatar
Thomas Mueller committed
62
<img class="screenshot" src="images/quickstart-2.png" alt="Screenshot: H2 running" /><br />
63
Also, a new browser page should open with the URL <a href="http://localhost:8082" class="notranslate">http://localhost:8082</a>.
64 65 66 67 68 69
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.
</p>

<h4>Login</h4>
<p>
70
Select [Generic H2] and click [Connect]:<br />
Thomas Mueller's avatar
Thomas Mueller committed
71
    <img class="screenshot" src="images/quickstart-3.png" alt="Screenshot: login" /><br />
72 73 74 75 76
    You are now logged in.
</p>

<h4>Sample</h4>
<p>
77
Click on the [Sample SQL Script]:<br />
Thomas Mueller's avatar
Thomas Mueller committed
78
    <img class="screenshot" src="images/quickstart-4.png" alt="Screenshot: click on the sample SQL script" /><br />
Thomas Mueller's avatar
Thomas Mueller committed
79
    The SQL commands appear in the command area.<br />
80 81 82 83
</p>

<h4>Execute</h4>
<p>
84
Click [Run]<br />
Thomas Mueller's avatar
Thomas Mueller committed
85
<img class="screenshot" src="images/quickstart-5.png" alt="Screenshot: click Run" /><br />
86 87
On the left side, a new entry TEST is added below the database icon.
The operations and results of the statements are shown below the script.<br />
Thomas Mueller's avatar
Thomas Mueller committed
88
<img class="screenshot" src="images/quickstart-6.png" alt="Screenshot: see the result" /><br />
89 90 91 92
</p>

<h4>Disconnect</h4>
<p>
93
Click on [Disconnect]:<br />
94
<img src="images/icon_disconnect.gif" alt="Disconnect icon" /><br />
95
to close the connection.
96 97 98 99 100 101 102 103 104 105
</p>

<h4>End</h4>
<p>
Close the console window.
For more information, see the <a href="tutorial.html">Tutorial</a>.
</p>

<!-- [close] { --></div></td></tr></table><!-- } --><!-- analytics --></body></html>