Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
1256ab7b
提交
1256ab7b
authored
15 年前
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Cheat sheet
上级
800c3dfa
master
noel-pr1
plus33-master
pr/267
stumc-Issue#576
version-1.1.x
version-1.4.198
version-1.4.197
version-1.4.196
version-1.4.195
version-1.4.194
version-1.4.193
version-1.4.192
version-1.4.191
version-1.4.190
version-1.4.188
version-1.4.187
version-1.4.186
version-1.4.185
version-1.4.184
version-1.4.183
version-1.4.182
version-1.4.181
version-1.4.178
version-1.4.177
version-1.3
version-1.2
version-1.1
version-1.0
无相关合并请求
隐藏空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
197 行增加
和
0 行删除
+197
-0
cheatSheet.html
h2/src/docsrc/html/cheatSheet.html
+197
-0
没有找到文件。
h2/src/
installer
/cheatSheet.html
→
h2/src/
docsrc/html
/cheatSheet.html
浏览文件 @
1256ab7b
...
@@ -11,15 +11,13 @@ H2 Database Engine
...
@@ -11,15 +11,13 @@ H2 Database Engine
</title>
</title>
<style
type=
"text/css"
>
<style
type=
"text/css"
>
td
,
input
,
select
,
textarea
,
body
,
td
,
th
{
td
,
input
,
select
,
textarea
,
body
,
td
,
th
{
font
:
9pt
/
130%
Tahoma
,
Arial
,
Helvetica
,
sans-serif
;
font
:
9pt
Tahoma
,
Arial
,
Helvetica
,
sans-serif
;
font-weight
:
normal
;
font-weight
:
normal
;
}
}
h1
,
h2
,
h3
,
h4
,
h5
{
h1
,
h2
,
h3
,
h4
,
h5
{
font
:
9pt
Tahoma
,
Arial
,
Helvetica
,
sans-serif
;
font
:
9pt
Tahoma
,
Arial
,
Helvetica
,
sans-serif
;
font-weight
:
bold
;
font-weight
:
bold
;
}
}
h1
{
h1
{
background-color
:
#0000bb
;
background-color
:
#0000bb
;
padding
:
2px
4px
2px
4px
;
padding
:
2px
4px
2px
4px
;
...
@@ -27,39 +25,48 @@ h1 {
...
@@ -27,39 +25,48 @@ h1 {
font-size
:
15pt
;
font-size
:
15pt
;
line-height
:
normal
;
line-height
:
normal
;
}
}
h2
{
h2
{
font-size
:
10pt
;
font-size
:
10pt
;
}
}
a
.link
{
text-decoration
:
underline
;
color
:
blue
;
}
a
.link
:hover
{
text-decoration
:
underline
;
color
:
blue
;
}
a
{
text-decoration
:
none
;
color
:
black
;
}
a
:hover
{
text-decoration
:
underline
;
color
:
blue
;
}
td
,
input
,
select
,
textarea
,
body
,
code
,
pre
{
td
,
input
,
select
,
textarea
,
body
,
code
,
pre
{
font-size
:
9pt
;
font-size
:
9pt
;
}
}
pre
{
pre
{
background-color
:
#ece9d8
;
background-color
:
#ece9d8
;
border
:
1px
solid
rgb
(
172
,
168
,
153
);
border
:
1px
solid
rgb
(
172
,
168
,
153
);
padding
:
4px
;
padding
:
4px
;
}
}
code
{
code
{
background-color
:
#ece9d8
;
background-color
:
#ece9d8
;
padding
:
0px
2px
;
padding
:
0px
2px
;
}
}
table
{
table
{
background-color
:
#ffffff
;
background-color
:
#ffffff
;
border-collapse
:
collapse
;
border-collapse
:
collapse
;
border
:
0px
solid
#aca899
;
border
:
0px
solid
#aca899
;
}
}
th
{
th
{
text-align
:
left
;
text-align
:
left
;
background-color
:
#ece9d8
;
background-color
:
#ece9d8
;
border
:
1px
solid
#aca899
;
border
:
1px
solid
#aca899
;
padding
:
2px
;
padding
:
2px
;
}
}
td
{
td
{
background-color
:
#ffffff
;
background-color
:
#ffffff
;
text-align
:
left
;
text-align
:
left
;
...
@@ -67,16 +74,13 @@ td {
...
@@ -67,16 +74,13 @@ td {
border
:
0px
solid
#aca899
;
border
:
0px
solid
#aca899
;
padding
:
2px
;
padding
:
2px
;
}
}
ul
,
ol
{
ul
,
ol
{
list-style-position
:
outside
;
list-style-position
:
outside
;
padding-left
:
20px
;
padding-left
:
20px
;
}
}
li
{
li
{
margin-top
:
2px
;
margin-top
:
2px
;
}
}
</style>
</style>
</head><body>
</head><body>
...
@@ -86,56 +90,66 @@ li {
...
@@ -86,56 +90,66 @@ li {
<div
style=
"float:left; margin:5px; width:320px;"
>
<div
style=
"float:left; margin:5px; width:320px;"
>
<h2>
Using H2
</h2>
<h2>
Using H2
</h2>
<ul><li>
H2 is open source, free to use and distribute.
<ul><li><a
href=
"http://h2database.com"
>
H2
</a>
is
</li><li>
Download the
<a
href=
"http://code.google.com/p/h2database/source"
>
open source
</a>
,
<a
href=
"http://repo1.maven.org/maven2/com/h2database/h2/1.1.111/h2-1.1.111.jar"
>
jar file
</a>
,
<a
href=
"license.html"
>
free to use and distribute
</a>
.
<a
href=
"http://www.h2database.com/h2-setup-2009-04-10.exe"
>
Windows installer
</a>
, or
</li><li><a
href=
"http://h2database.com/html/download.html"
>
Download
</a>
:
<a
href=
"http://www.h2database.com/h2-2009-04-10.zip"
>
zip file
</a>
.
<a
href=
"http://repo1.maven.org/maven2/com/h2database/h2/${version}/h2-${version}.jar"
class=
"link"
>
jar
</a>
,
</li><li>
To start the H2 Console tool, double click the jar file, or run
<code>
java -jar h2*.jar
</code>
,
<code>
h2.bat
</code>
or
<code>
h2.sh
</code>
.
<a
href=
"http://www.h2database.com/h2-setup-${versionDate}.exe"
class=
"link"
>
installer (Windows)
</a>
,
</li><li>
A new database is automatically created if it does not yet exist.
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
class=
"link"
>
zip
</a>
.
</li><li>
Closing the last connection closes a database.
</li><li>
To start the
<a
href=
"quickstart.html#h2_console"
>
H2 Console tool
</a>
, double click the jar file, or
run
<code>
java -jar h2*.jar
</code>
,
<code>
h2.bat
</code>
, or
<code>
h2.sh
</code>
.
</li><li><a
href=
"tutorial.html#creating_new_databases"
>
A new database is automatically created
</a>
<a
href=
"features.html#database_only_if_exists"
>
by default
</a>
.
</li><li><a
href=
"features.html#closing_a_database"
>
Closing the last connection closes the database
</a>
.
</li></ul>
</li></ul>
<h2>
D
atabase URLs
</h2>
<h2>
D
ocumentation
</h2>
<p>
<p>
<b>
Embedded
</b><br
/>
Reference:
<a
href=
"grammar.html"
class=
"link"
>
SQL grammar
</a>
,
<a
href=
"functions.html"
class=
"link"
>
functions
</a>
,
<a
href=
"datatypes.html"
class=
"link"
>
data types
</a>
,
<a
href=
"tutorial.html#command_line_tools"
class=
"link"
>
tools
</a>
,
<a
href=
"../javadoc/index.html"
class=
"link"
>
API
</a>
<br
/>
<a
href=
"features.html"
>
Features
</a>
:
<a
href=
"tutorial.html#fulltext"
class=
"link"
>
fulltext search
</a>
,
<a
href=
"features.html#file_encryption"
class=
"link"
>
encryption
</a>
,
<a
href=
"features.html#read_only"
class=
"link"
>
read-only
</a>
<a
href=
"features.html#database_in_zip"
class=
"link"
>
(zip/jar)
</a>
,
<a
href=
"tutorial.html#csv"
class=
"link"
>
CSV
</a>
,
<a
href=
"features.html#auto_reconnect"
class=
"link"
>
auto-reconnect
</a>
,
<a
href=
"features.html#triggers"
class=
"link"
>
triggers
</a>
,
<a
href=
"features.html#user_defined_functions"
class=
"link"
>
user functions
</a>
</p>
<h2><a
href=
"features.html#database_url"
>
Database URLs
</a></h2>
<p>
<b><a
href=
"features.html#connection_modes"
>
Embedded
</a></b><br
/>
<code>
jdbc:h2:~/test
</code>
'test' in the user home directory
<br
/>
<code>
jdbc:h2:~/test
</code>
'test' in the user home directory
<br
/>
<code>
jdbc:h2:/data/test
</code>
'test' in the directory /data
/
<br
/>
<code>
jdbc:h2:/data/test
</code>
'test' in the directory /data
<br
/>
<code>
jdbc:h2:test
</code>
in the current(!) working dir
<br
/>
<code>
jdbc:h2:test
</code>
in the current(!) working dir
ectory
<br
/>
</p><p>
</p><p>
<b>
In-Memory
</b><br
/>
<b>
<a
href=
"features.html#in_memory_databases"
>
In-Memory
</a>
</b><br
/>
<code>
jdbc:h2:mem:test
</code>
multiple connections in one process
<br
/>
<code>
jdbc:h2:mem:test
</code>
multiple connections in one process
<br
/>
<code>
jdbc:h2:mem:
</code>
unnamed private; one connection
<br
/>
<code>
jdbc:h2:mem:
</code>
unnamed private; one connection
<br
/>
</p><p>
</p><p>
<b>
Server Mode
</b><br
/>
<b>
<a
href=
"tutorial.html#using_server"
>
Server Mode
</a>
</b><br
/>
<code>
jdbc:h2:tcp://localhost/~/test
</code>
user home dir
<br
/>
<code>
jdbc:h2:tcp://localhost/~/test
</code>
user home dir
<br
/>
<code>
jdbc:h2:tcp://localhost//data/test
</code>
absolute dir
<br
/>
<code>
jdbc:h2:tcp://localhost//data/test
</code>
absolute dir
<br
/>
<a
href=
"tutorial.html#using_server"
>
Server start
</a>
:
<code>
java -cp *.jar org.h2.tools.Server
</code>
</p><p>
</p><p>
<b>
Settings
</b><br
/>
<b>
<a
href=
"features.html#database_url"
>
Settings
</a>
</b><br
/>
<code>
jdbc:h2:..;MODE=MySQL
</code>
compatibility (or HSQLDB,...)
<br
/>
<code>
jdbc:h2:..;MODE=MySQL
</code>
<a
href=
"features.html#compatibility"
>
compatibility (or HSQLDB,...)
</a>
<br
/>
<code>
jdbc:h2:..;TRACE_LEVEL_FILE=3
</code>
log to *.trace.db
<br
/>
<code>
jdbc:h2:..;TRACE_LEVEL_FILE=3
</code>
<a
href=
"features.html#trace_options"
>
log to *.trace.db
</a>
<br
/>
</p>
</p>
<h2>
Documentation
</h2>
Reference:
<a
href=
"http://www.h2database.com/html/grammar.html"
>
SQL grammar
</a>
,
<a
href=
"http://www.h2database.com/html/functions.html"
>
functions
</a>
,
<a
href=
"http://www.h2database.com/html/datatypes.html"
>
data types
</a>
,
<a
href=
"http://www.h2database.com/html/datatypes.html"
>
tools
</a>
.
<br
/>
Features:
<a
href=
"http://www.h2database.com/html/grammar.html"
>
fulltext search
</a>
,
<a
href=
"http://www.h2database.com/html/functions.html"
>
database encryption
</a>
,
<a
href=
"http://www.h2database.com/html/datatypes.html"
>
read-only databases
</a>
<a
href=
"http://www.h2database.com/html/datatypes.html"
>
(in a zip or jar file)
</a>
,
<a
href=
"http://www.h2database.com/html/datatypes.html"
>
CSV files
</a>
,
<br
/>
</div>
</div>
<div
style=
"float:right; padding:5px; width:320px;"
>
<div
style=
"float:right; padding:5px; width:320px;"
>
<h2>
Using the JDBC API
</h2>
<h2>
<a
href=
"tutorial.html#connecting_using_jdbc"
>
Using the JDBC API
</a>
</h2>
<pre>
<pre>
Class.forName("org.h2.Driver");
Class.forName("org.h2.Driver");
Connection conn = DriverManager.
Connection conn = DriverManager.
...
@@ -143,7 +157,7 @@ Connection conn = DriverManager.
...
@@ -143,7 +157,7 @@ Connection conn = DriverManager.
conn.close();
conn.close();
</pre>
</pre>
<h2>
Connection Pool
</h2>
<h2>
<a
href=
"tutorial.html#connection_pool"
>
Connection Pool
</a>
</h2>
<pre>
<pre>
import org.h2.jdbcx.JdbcConnectionPool;
import org.h2.jdbcx.JdbcConnectionPool;
DataSource cp = JdbcConnectionPool.
DataSource cp = JdbcConnectionPool.
...
@@ -152,12 +166,7 @@ Connection conn = cp.getConnection();
...
@@ -152,12 +166,7 @@ Connection conn = cp.getConnection();
conn.close(); cp.dispose();
conn.close(); cp.dispose();
</pre>
</pre>
<h2>
Start a Server
</h2>
<h2><a
href=
"build.html#maven2"
>
Maven 2
</a></h2>
<pre>
java -cp h2*.jar org.h2.tools.Server
</pre>
<h2>
Maven
</h2>
<pre>
<pre>
<
dependency
>
<
dependency
>
<
groupId
>
com.h2database
<
/groupId
>
<
groupId
>
com.h2database
<
/groupId
>
...
@@ -166,7 +175,7 @@ java -cp h2*.jar org.h2.tools.Server
...
@@ -166,7 +175,7 @@ java -cp h2*.jar org.h2.tools.Server
<
/dependency
>
<
/dependency
>
</pre>
</pre>
<h2>
Hibernate
</h2>
<h2>
<a
href=
"tutorial.html#using_hibernate"
>
Hibernate
</a>
</h2>
hibernate.cfg.xml (or use the HSQLDialect):
hibernate.cfg.xml (or use the HSQLDialect):
<pre>
<pre>
<
property name="dialect"
>
<
property name="dialect"
>
...
@@ -174,9 +183,12 @@ hibernate.cfg.xml (or use the HSQLDialect):
...
@@ -174,9 +183,12 @@ hibernate.cfg.xml (or use the HSQLDialect):
<
/property
>
<
/property
>
</pre>
</pre>
<h2>
TopLink and Glassfish
</h2>
<h2><a
href=
"tutorial.html#using_toplink"
>
TopLink and Glassfish
</a></h2>
datasource classname: org.h2.jdbcx.JdbcDataSource
<br
/>
<p>
oracle.toplink.essentials.platform.database.H2Platform
Datasource class:
<code>
org.h2.jdbcx.JdbcDataSource
</code><br
/>
<code>
oracle.toplink.essentials.platform.
</code><br
/>
<code>
database.H2Platform
</code>
</p>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论