Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
17712d53
提交
17712d53
authored
10月 03, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
fed5361e
全部展开
显示空白字符变更
内嵌
并排
正在显示
23 个修改的文件
包含
1467 行增加
和
1365 行删除
+1467
-1365
advanced.html
h2/src/docsrc/html/advanced.html
+1
-1
changelog.html
h2/src/docsrc/html/changelog.html
+17
-1
download.html
h2/src/docsrc/html/download.html
+5
-5
mainWeb.html
h2/src/docsrc/html/mainWeb.html
+3
-3
roadmap.html
h2/src/docsrc/html/roadmap.html
+1
-0
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+452
-440
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+452
-440
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+446
-442
buildRelease.bat
h2/src/installer/buildRelease.bat
+1
-0
Constants.java
h2/src/main/org/h2/engine/Constants.java
+9
-9
help.csv
h2/src/main/org/h2/res/help.csv
+4
-0
TcpServer.java
h2/src/main/org/h2/server/TcpServer.java
+8
-1
PgServer.java
h2/src/main/org/h2/server/pg/PgServer.java
+7
-1
WebThread.java
h2/src/main/org/h2/server/web/WebThread.java
+7
-1
FileLock.java
h2/src/main/org/h2/store/FileLock.java
+3
-7
Column.java
h2/src/main/org/h2/table/Column.java
+1
-0
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+41
-1
TestCases.java
h2/src/test/org/h2/test/db/TestCases.java
+0
-6
TestCluster.java
h2/src/test/org/h2/test/db/TestCluster.java
+2
-2
TestTools.java
h2/src/test/org/h2/test/unit/TestTools.java
+2
-2
web.xml
h2/src/tools/WEB-INF/web.xml
+2
-0
GenerateDoc.java
h2/src/tools/org/h2/build/doc/GenerateDoc.java
+2
-2
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+1
-1
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
17712d53
...
@@ -283,7 +283,7 @@ java org.h2.tools.CreateCluster
...
@@ -283,7 +283,7 @@ java org.h2.tools.CreateCluster
-urlSource jdbc:h2:tcp://localhost:9101/~/test
-urlSource jdbc:h2:tcp://localhost:9101/~/test
-urlTarget jdbc:h2:tcp://localhost:9102/~/test
-urlTarget jdbc:h2:tcp://localhost:9102/~/test
-user sa
-user sa
-server
l
ist localhost:9101,localhost:9102
-server
L
ist localhost:9101,localhost:9102
</pre>
</pre>
</li><li>
You can now connect to the databases using
</li><li>
You can now connect to the databases using
an application or the H2 Console using the JDBC URL
an application or the H2 Console using the JDBC URL
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
17712d53
...
@@ -18,7 +18,23 @@ Change Log
...
@@ -18,7 +18,23 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
-
<ul><li>
The Console tool now supports command line options to start things separately.
</li><li>
Large objects did not work for in-memory databases in server mode in Linux.
</li><li>
Connections from a local address other than 'localhost' were not allowed if remote
connections were disabled. This was always a problem, but only got visible in the last release
because the server no longer connects to 'localhost' if networked.
</li><li>
The h2console.war can now be built using the Java build.
</li><li>
By default, databases are shared in the same process. For read-only databases
this causes unnecessary synchronization, but safes memory. If you want that each connection
opens its own database, append ;OPEN_NEW=TRUE to the database URL.
</li><li>
New auto-reconnect feature will setting causes the JDBC driver to reconnect to
the database if the connection is lost. To enable, append ;AUTO_RECONNECT=TRUE to the database URL.
This is specially helpful when using AUTO_SERVER.
</li><li>
CreateCluster: the property 'serverlist' is now called 'serverList'.
</li><li>
The ConvertTraceFile tool could not parse some files because the trace
mechanism did not encode prepared statement parameters.
</li><li>
Databases names can now be one character long
(the minimum size used to be 2 characters).
</li></ul>
</li></ul>
<h2>
Version 1.0.79 (2008-09-26)
</h2>
<h2>
Version 1.0.79 (2008-09-26)
</h2>
...
...
h2/src/docsrc/html/download.html
浏览文件 @
17712d53
...
@@ -19,19 +19,19 @@ Downloads
...
@@ -19,19 +19,19 @@ Downloads
<h1>
Downloads
</h1>
<h1>
Downloads
</h1>
<h3>
Version ${version} (${versionDate},
Current
)
</h3>
<h3>
Version ${version} (${versionDate},
Beta
)
</h3>
<p>
<p>
<a
href=
"http://www.h2database.com/h2-setup-${versionDate}.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-setup-${versionDate}.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
Platform-Independent Zip
</a><br
/>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
Platform-Independent Zip
</a><br
/>
</p>
</p>
<h3>
Version ${
previousVersion} (${previous
VersionDate}, Last Stable)
</h3>
<h3>
Version ${
stableVersion} (${stable
VersionDate}, Last Stable)
</h3>
<p>
<p>
<a
href=
"http://www.h2database.com/h2-setup-${
previous
VersionDate}.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-setup-${
stable
VersionDate}.exe"
>
Windows Installer
</a><br
/>
<a
href=
"http://www.h2database.com/h2-${
previous
VersionDate}.zip"
>
Platform-Independent Zip
</a><br
/>
<a
href=
"http://www.h2database.com/h2-${
stable
VersionDate}.zip"
>
Platform-Independent Zip
</a><br
/>
</p>
</p>
<h3>
Download
Mirror and
Older Versions
</h3>
<h3>
Download Older Versions
</h3>
<p>
<p>
<a
href=
"http://code.google.com/p/h2database/downloads/list"
>
Platform-Independent Zip
</a><br
/>
<a
href=
"http://code.google.com/p/h2database/downloads/list"
>
Platform-Independent Zip
</a><br
/>
</p>
</p>
...
...
h2/src/docsrc/html/mainWeb.html
浏览文件 @
17712d53
...
@@ -31,9 +31,9 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
...
@@ -31,9 +31,9 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
<table
style=
"border: 0px; width: 395px;"
>
<table
style=
"border: 0px; width: 395px;"
>
<tr><td
style=
"background-color: #eee;"
>
<tr><td
style=
"background-color: #eee;"
>
<table
style=
"border: 0px; margin: 5px; background-color: #eee;"
>
<table
style=
"border: 0px; margin:
0px
5px; background-color: #eee;"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<h3>
Download
</h3>
<h3>
Download
Beta
</h3>
Version ${version} (${versionDate}):
Version ${version} (${versionDate}):
</td></tr>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
>
...
@@ -47,7 +47,7 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
...
@@ -47,7 +47,7 @@ Welcome to H2, the Java SQL database. The main feature of H2 are:
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
All platforms (zip, 4.6 MB)
</a>
<a
href=
"http://www.h2database.com/h2-${versionDate}.zip"
>
All platforms (zip, 4.6 MB)
</a>
</td></tr>
</td></tr>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<tr><td
style=
"border: 0px; background-color: #eee;"
colspan=
"2"
>
<a
href=
"download.html"
>
All Downloads
</a>
<a
href=
"download.html"
>
All Downloads
(including Stable)
</a>
</td></tr>
</td></tr>
</table>
</table>
</td><td
style=
"border: 0px;"
>
</td>
</td><td
style=
"border: 0px;"
>
</td>
...
...
h2/src/docsrc/html/roadmap.html
浏览文件 @
17712d53
...
@@ -391,6 +391,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
...
@@ -391,6 +391,7 @@ Of course, patches are always welcome, but are not always applied as is. Patches
</li><li>
Document FTL_SEARCH, FTL_SEARCH_DATA.
</li><li>
Document FTL_SEARCH, FTL_SEARCH_DATA.
</li><li>
Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts.
</li><li>
Support DatabaseMetaData.insertsAreDetected: updatable result sets should detect inserts.
</li><li>
Auto-server: add option to define the IP address range or list.
</li><li>
Auto-server: add option to define the IP address range or list.
</li><li>
Open a read-only database but don't share it with other connections. jdbc:h2:~/test;PRIVATE=TRUE
</li></ul>
</li></ul>
<h2>
Not Planned
</h2>
<h2>
Not Planned
</h2>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
17712d53
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
17712d53
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
17712d53
差异被折叠。
点击展开。
h2/src/installer/buildRelease.bat
浏览文件 @
17712d53
...
@@ -63,6 +63,7 @@ rem == svn copy: /svn/trunk /svn/tags/version-1.0.x; Version 1.0.x (yyyy-mm-dd)
...
@@ -63,6 +63,7 @@ rem == svn copy: /svn/trunk /svn/tags/version-1.0.x; Version 1.0.x (yyyy-mm-dd)
rem == Newsletter: prepare (always to BCC!!)
rem == Newsletter: prepare (always to BCC!!)
rem == Upload to h2database.com, http://code.google.com/p/h2database/downloads/list
rem == Upload to h2database.com, http://code.google.com/p/h2database/downloads/list
rem == Newsletter: send (always to BCC!!)
rem == Newsletter: send (always to BCC!!)
rem == Remove Contacts in GMail
rem == Add to freshmeat
rem == Add to freshmeat
rem == Change version: http://en.wikipedia.org/wiki/H2_%28DBMS%29
rem == Change version: http://en.wikipedia.org/wiki/H2_%28DBMS%29
rem == Change version: http://ja.wikipedia.org/wiki/H2_Database
rem == Change version: http://ja.wikipedia.org/wiki/H2_Database
...
...
h2/src/main/org/h2/engine/Constants.java
浏览文件 @
17712d53
...
@@ -80,22 +80,22 @@ public class Constants {
...
@@ -80,22 +80,22 @@ public class Constants {
/**
/**
* The build id is incremented for each public release.
* The build id is incremented for each public release.
*/
*/
public
static
final
int
BUILD_ID
=
79
;
public
static
final
int
BUILD_ID
=
100
;
/**
/**
* The build id of the
previous
release.
* The build id of the
last stable
release.
*/
*/
public
static
final
int
BUILD_ID_
PREVIOUS
=
78
;
public
static
final
int
BUILD_ID_
STABLE
=
79
;
/**
/**
* The build date is updated for each public release.
* The build date is updated for each public release.
*/
*/
public
static
final
String
BUILD_DATE
=
"2008-09-2
6
"
;
public
static
final
String
BUILD_DATE
=
"2008-09-2
9
"
;
/**
/**
* The build date is updated for each public release.
* The build date is updated for each public release.
*/
*/
public
static
final
String
BUILD_DATE_
PREVIOUS
=
"2008-08-28
"
;
public
static
final
String
BUILD_DATE_
STABLE
=
"2008-09-26
"
;
/**
/**
* The TCP protocol version number 5. This protocol is used by the TCP
* The TCP protocol version number 5. This protocol is used by the TCP
...
@@ -117,7 +117,7 @@ public class Constants {
...
@@ -117,7 +117,7 @@ public class Constants {
/**
/**
* The minor version of this product.
* The minor version of this product.
*/
*/
public
static
final
int
VERSION_MINOR
=
0
;
public
static
final
int
VERSION_MINOR
=
1
;
/**
/**
* The version number (major.minor) of this product.
* The version number (major.minor) of this product.
...
@@ -584,12 +584,12 @@ public class Constants {
...
@@ -584,12 +584,12 @@ public class Constants {
}
}
/**
/**
* Get the
version of the previous version
.
* Get the
last stable version name
.
*
*
* @return the version number
* @return the version number
*/
*/
public
static
Object
getVersion
Previous
()
{
public
static
Object
getVersion
Stable
()
{
return
VERSION_MAJOR
+
"."
+
VERSION_MINOR
+
"."
+
BUILD_ID_PREVIOUS
;
return
"1.0."
+
BUILD_ID_STABLE
;
}
}
/**
/**
...
...
h2/src/main/org/h2/res/help.csv
浏览文件 @
17712d53
...
@@ -2764,6 +2764,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt
...
@@ -2764,6 +2764,7 @@ CSVREAD(fileNameString [, columnNamesString [, charsetString [, fieldSeparatorSt
[, escapeCharacterString [, nullString]]]]]]): resultSet
[, escapeCharacterString [, nullString]]]]]]): resultSet
","
","
Returns the result set of reading the CSV (comma separated values) file.
Returns the result set of reading the CSV (comma separated values) file.
For each parameter, NULL means the default value should be used.
If the column names are specified (a list of column names separated with the fieldSeparator),
If the column names are specified (a list of column names separated with the fieldSeparator),
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
those are used they are read from the file, otherwise (or if they are set to NULL) the first line
of the file is interpreted as the column names.
of the file is interpreted as the column names.
...
@@ -2776,6 +2777,8 @@ Admin rights are required to execute this command.
...
@@ -2776,6 +2777,8 @@ Admin rights are required to execute this command.
CALL CSVREAD('test.csv');
CALL CSVREAD('test.csv');
-- Read a file containing the columns ID, NAME with UTF-8 encoding and the pipe (|) as field separator
-- Read a file containing the columns ID, NAME with UTF-8 encoding and the pipe (|) as field separator
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
CALL CSVREAD('test2.csv', 'ID|NAME', 'UTF-8', '|');
-- Read a semicolon-separated file
SELECT * FROM CSVREAD('data/test.csv', NULL, NULL, ';');
"
"
"Functions (System)","CSVWRITE","
"Functions (System)","CSVWRITE","
...
@@ -2784,6 +2787,7 @@ CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparatorString [,
...
@@ -2784,6 +2787,7 @@ CSVWRITE(fileNameString, queryString [, charsetString [, fieldSeparatorString [,
","
","
Writes a CSV (comma separated values).
Writes a CSV (comma separated values).
The file is overwritten if it exists.
The file is overwritten if it exists.
For each parameter, NULL means the default value should be used.
The default charset is the default value for this system, and the default field separator is a comma.
The default charset is the default value for this system, and the default field separator is a comma.
The null string is used when writing NULL (by default nothing is written when NULL appears).
The null string is used when writing NULL (by default nothing is written when NULL appears).
The default line separator is the default value for this system ('line.separator' system property).
The default line separator is the default value for this system ('line.separator' system property).
...
...
h2/src/main/org/h2/server/TcpServer.java
浏览文件 @
17712d53
...
@@ -9,6 +9,7 @@ package org.h2.server;
...
@@ -9,6 +9,7 @@ package org.h2.server;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.ServerSocket
;
import
java.net.ServerSocket
;
import
java.net.Socket
;
import
java.net.Socket
;
import
java.net.UnknownHostException
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.DriverManager
;
import
java.sql.DriverManager
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
...
@@ -212,10 +213,16 @@ public class TcpServer implements Service {
...
@@ -212,10 +213,16 @@ public class TcpServer implements Service {
if
(
allowOthers
)
{
if
(
allowOthers
)
{
return
true
;
return
true
;
}
}
return
NetUtils
.
isLoopbackAddress
(
socket
);
try
{
return
NetUtils
.
isLocalAddress
(
socket
);
}
catch
(
UnknownHostException
e
)
{
traceError
(
e
);
return
false
;
}
}
}
public
synchronized
void
start
()
throws
SQLException
{
public
synchronized
void
start
()
throws
SQLException
{
stop
=
false
;
serverSocket
=
NetUtils
.
createServerSocket
(
port
,
ssl
);
serverSocket
=
NetUtils
.
createServerSocket
(
port
,
ssl
);
port
=
serverSocket
.
getLocalPort
();
port
=
serverSocket
.
getLocalPort
();
initManagementDb
();
initManagementDb
();
...
...
h2/src/main/org/h2/server/pg/PgServer.java
浏览文件 @
17712d53
...
@@ -9,6 +9,7 @@ package org.h2.server.pg;
...
@@ -9,6 +9,7 @@ package org.h2.server.pg;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.net.ServerSocket
;
import
java.net.ServerSocket
;
import
java.net.Socket
;
import
java.net.Socket
;
import
java.net.UnknownHostException
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.PreparedStatement
;
import
java.sql.ResultSet
;
import
java.sql.ResultSet
;
...
@@ -127,7 +128,12 @@ public class PgServer implements Service {
...
@@ -127,7 +128,12 @@ public class PgServer implements Service {
if
(
allowOthers
)
{
if
(
allowOthers
)
{
return
true
;
return
true
;
}
}
return
NetUtils
.
isLoopbackAddress
(
socket
);
try
{
return
NetUtils
.
isLocalAddress
(
socket
);
}
catch
(
UnknownHostException
e
)
{
traceError
(
e
);
return
false
;
}
}
}
public
void
start
()
throws
SQLException
{
public
void
start
()
throws
SQLException
{
...
...
h2/src/main/org/h2/server/web/WebThread.java
浏览文件 @
17712d53
...
@@ -22,6 +22,7 @@ import java.io.StringReader;
...
@@ -22,6 +22,7 @@ import java.io.StringReader;
import
java.io.StringWriter
;
import
java.io.StringWriter
;
import
java.lang.reflect.Method
;
import
java.lang.reflect.Method
;
import
java.net.Socket
;
import
java.net.Socket
;
import
java.net.UnknownHostException
;
import
java.security.SecureClassLoader
;
import
java.security.SecureClassLoader
;
import
java.sql.Connection
;
import
java.sql.Connection
;
import
java.sql.DatabaseMetaData
;
import
java.sql.DatabaseMetaData
;
...
@@ -2101,7 +2102,12 @@ class WebThread extends Thread implements DatabaseEventListener {
...
@@ -2101,7 +2102,12 @@ class WebThread extends Thread implements DatabaseEventListener {
if
(
server
.
getAllowOthers
())
{
if
(
server
.
getAllowOthers
())
{
return
true
;
return
true
;
}
}
return
NetUtils
.
isLoopbackAddress
(
socket
);
try
{
return
NetUtils
.
isLocalAddress
(
socket
);
}
catch
(
UnknownHostException
e
)
{
server
.
traceError
(
e
);
return
false
;
}
}
}
/**
/**
...
...
h2/src/main/org/h2/store/FileLock.java
浏览文件 @
17712d53
...
@@ -300,13 +300,9 @@ public class FileLock {
...
@@ -300,13 +300,9 @@ public class FileLock {
method
=
SOCKET
;
method
=
SOCKET
;
properties
=
new
SortedProperties
();
properties
=
new
SortedProperties
();
setUniqueId
();
setUniqueId
();
try
{
// TODO documentation: if this returns 127.0.0.1,
// TODO documentation: if this returns 127.0.0.1,
// the computer is probably not networked
// the computer is probably not networked
ipAddress
=
InetAddress
.
getLocalHost
().
getHostAddress
();
ipAddress
=
NetUtils
.
getLocalAddress
();
}
catch
(
UnknownHostException
e
)
{
throw
getException
(
e
);
}
if
(!
fs
.
createNewFile
(
fileName
))
{
if
(!
fs
.
createNewFile
(
fileName
))
{
waitUntilOld
();
waitUntilOld
();
long
read
=
fs
.
getLastModified
(
fileName
);
long
read
=
fs
.
getLastModified
(
fileName
);
...
...
h2/src/main/org/h2/table/Column.java
浏览文件 @
17712d53
...
@@ -130,6 +130,7 @@ public class Column {
...
@@ -130,6 +130,7 @@ public class Column {
newColumn
.
convertNullToDefault
=
convertNullToDefault
;
newColumn
.
convertNullToDefault
=
convertNullToDefault
;
newColumn
.
sequence
=
sequence
;
newColumn
.
sequence
=
sequence
;
newColumn
.
comment
=
comment
;
newColumn
.
comment
=
comment
;
newColumn
.
computeTableFilter
=
computeTableFilter
;
newColumn
.
isComputed
=
isComputed
;
newColumn
.
isComputed
=
isComputed
;
newColumn
.
selectivity
=
selectivity
;
newColumn
.
selectivity
=
selectivity
;
newColumn
.
primaryKey
=
primaryKey
;
newColumn
.
primaryKey
=
primaryKey
;
...
...
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
17712d53
...
@@ -78,6 +78,7 @@ import org.h2.test.mvcc.TestMvcc2;
...
@@ -78,6 +78,7 @@ import org.h2.test.mvcc.TestMvcc2;
import
org.h2.test.mvcc.TestMvcc3
;
import
org.h2.test.mvcc.TestMvcc3
;
import
org.h2.test.mvcc.TestMvccMultiThreaded
;
import
org.h2.test.mvcc.TestMvccMultiThreaded
;
import
org.h2.test.rowlock.TestRowLocks
;
import
org.h2.test.rowlock.TestRowLocks
;
import
org.h2.test.server.TestAutoReconnect
;
import
org.h2.test.server.TestAutoServer
;
import
org.h2.test.server.TestAutoServer
;
import
org.h2.test.server.TestNestedLoop
;
import
org.h2.test.server.TestNestedLoop
;
import
org.h2.test.server.TestPgServer
;
import
org.h2.test.server.TestPgServer
;
...
@@ -275,9 +276,47 @@ java org.h2.test.TestAll timer
...
@@ -275,9 +276,47 @@ java org.h2.test.TestAll timer
/*
/*
14.zip
Open Anzo
http://www.openanzo.org
Semantic Application Server
H2 Dialect for TopLink
http://www.marciowb.net/blog/2008/08/quickly-using-h2-database-with
osgi (derby, hsqldb)
private=true
auto_reconnect
implemented:
- works with server mode
- works with auto_server mode
- use the same property name as in MySQL (reconnect?)
- statements
- prepared statements
- small result sets (up to fetch size)
- throws an error when autocommit is false
untested:
- batch updates
- throw error for large result sets
- throw error in cluster mode
- ignored in embedded mode
- server mode, embedded (ignored)
not implemented
- temporary linked tables
- temporary tables
- variables
- in cluster mode (error)
- identity, getGeneratedKeys
check all version(s) before the release
check all version(s) before the release
Patch.zip
document url parameter auto_server
document url parameter auto_reconnect
document url parameter private
Add version number. Install directory: h2-1.1, jar file: h2-1.1.100.jar.
Add version number. Install directory: h2-1.1, jar file: h2-1.1.100.jar.
Micro version: use build number, staring with 1.1.100
Micro version: use build number, staring with 1.1.100
...
@@ -527,6 +566,7 @@ http://www.w3schools.com/sql/
...
@@ -527,6 +566,7 @@ http://www.w3schools.com/sql/
new
TestXASimple
().
runTest
(
this
);
new
TestXASimple
().
runTest
(
this
);
// server
// server
new
TestAutoReconnect
().
runTest
(
this
);
new
TestAutoServer
().
runTest
(
this
);
new
TestAutoServer
().
runTest
(
this
);
new
TestNestedLoop
().
runTest
(
this
);
new
TestNestedLoop
().
runTest
(
this
);
new
TestWeb
().
runTest
(
this
);
new
TestWeb
().
runTest
(
this
);
...
...
h2/src/test/org/h2/test/db/TestCases.java
浏览文件 @
17712d53
...
@@ -67,12 +67,6 @@ public class TestCases extends TestBase {
...
@@ -67,12 +67,6 @@ public class TestCases extends TestBase {
}
catch
(
SQLException
e
)
{
}
catch
(
SQLException
e
)
{
assertEquals
(
ErrorCode
.
INVALID_DATABASE_NAME_1
,
e
.
getErrorCode
());
assertEquals
(
ErrorCode
.
INVALID_DATABASE_NAME_1
,
e
.
getErrorCode
());
}
}
try
{
getConnection
(
"cases/a"
);
fail
();
}
catch
(
SQLException
e
)
{
assertEquals
(
ErrorCode
.
INVALID_DATABASE_NAME_1
,
e
.
getErrorCode
());
}
}
}
private
void
testReuseSpace
()
throws
SQLException
{
private
void
testReuseSpace
()
throws
SQLException
{
...
...
h2/src/test/org/h2/test/db/TestCluster.java
浏览文件 @
17712d53
...
@@ -50,7 +50,7 @@ public class TestCluster extends TestBase {
...
@@ -50,7 +50,7 @@ public class TestCluster extends TestBase {
conn
.
close
();
conn
.
close
();
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-server
l
ist"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-server
L
ist"
,
"localhost:9191,localhost:9192"
});
"localhost:9191,localhost:9192"
});
Server
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
Server
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
new
String
[]
{
"-tcpPort"
,
"9191"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
new
String
[]
{
"-tcpPort"
,
"9191"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
...
@@ -91,7 +91,7 @@ public class TestCluster extends TestBase {
...
@@ -91,7 +91,7 @@ public class TestCluster extends TestBase {
// re-create the cluster
// re-create the cluster
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node2"
,
"-quiet"
});
DeleteDbFiles
.
main
(
new
String
[]
{
"-dir"
,
baseDir
+
"/node2"
,
"-quiet"
});
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
CreateCluster
.
main
(
new
String
[]
{
"-urlSource"
,
"jdbc:h2:file:"
+
baseDir
+
"/node1/test"
,
"-urlTarget"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-server
l
ist"
,
"jdbc:h2:file:"
+
baseDir
+
"/node2/test"
,
"-user"
,
"sa"
,
"-server
L
ist"
,
"localhost:9191,localhost:9192"
});
"localhost:9191,localhost:9192"
});
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
n1
=
org
.
h2
.
tools
.
Server
.
createTcpServer
(
new
String
[]
{
"-tcpPort"
,
"9191"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
new
String
[]
{
"-tcpPort"
,
"9191"
,
"-baseDir"
,
baseDir
+
"/node1"
}).
start
();
...
...
h2/src/test/org/h2/test/unit/TestTools.java
浏览文件 @
17712d53
...
@@ -150,7 +150,7 @@ public class TestTools extends TestBase {
...
@@ -150,7 +150,7 @@ public class TestTools extends TestBase {
stat
.
execute
(
"create table test(id int primary key, name varchar, amount decimal)"
);
stat
.
execute
(
"create table test(id int primary key, name varchar, amount decimal)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test values(?, ?, ?)"
);
PreparedStatement
prep
=
conn
.
prepareStatement
(
"insert into test values(?, ?, ?)"
);
prep
.
setInt
(
1
,
1
);
prep
.
setInt
(
1
,
1
);
prep
.
setString
(
2
,
"Hello"
);
prep
.
setString
(
2
,
"Hello
\\'Joe\n\\'
"
);
prep
.
setBigDecimal
(
3
,
new
BigDecimal
(
"10.20"
));
prep
.
setBigDecimal
(
3
,
new
BigDecimal
(
"10.20"
));
prep
.
executeUpdate
();
prep
.
executeUpdate
();
stat
.
execute
(
"create table test2(id int primary key, a real, b double, c bigint, "
+
stat
.
execute
(
"create table test2(id int primary key, a real, b double, c bigint, "
+
...
@@ -194,7 +194,7 @@ public class TestTools extends TestBase {
...
@@ -194,7 +194,7 @@ public class TestTools extends TestBase {
rs
=
stat
.
executeQuery
(
"select * from test"
);
rs
=
stat
.
executeQuery
(
"select * from test"
);
rs
.
next
();
rs
.
next
();
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
1
,
rs
.
getInt
(
1
));
assertEquals
(
"Hello"
,
rs
.
getString
(
2
));
assertEquals
(
"Hello
\\'Joe\n\\'
"
,
rs
.
getString
(
2
));
assertEquals
(
"10.20"
,
rs
.
getBigDecimal
(
3
).
toString
());
assertEquals
(
"10.20"
,
rs
.
getBigDecimal
(
3
).
toString
());
assertFalse
(
rs
.
next
());
assertFalse
(
rs
.
next
());
rs
=
stat
.
executeQuery
(
"select * from test2"
);
rs
=
stat
.
executeQuery
(
"select * from test2"
);
...
...
h2/src/tools/WEB-INF/web.xml
浏览文件 @
17712d53
...
@@ -19,10 +19,12 @@ Initial Developer: H2 Group
...
@@ -19,10 +19,12 @@ Initial Developer: H2 Group
<servlet>
<servlet>
<servlet-name>
H2Console
</servlet-name>
<servlet-name>
H2Console
</servlet-name>
<servlet-class>
org.h2.server.web.WebServlet
</servlet-class>
<servlet-class>
org.h2.server.web.WebServlet
</servlet-class>
<!--
<init-param>
<init-param>
<param-name>trace</param-name>
<param-name>trace</param-name>
<param-value></param-value>
<param-value></param-value>
</init-param>
</init-param>
-->
<load-on-startup>
1
</load-on-startup>
<load-on-startup>
1
</load-on-startup>
</servlet>
</servlet>
...
...
h2/src/tools/org/h2/build/doc/GenerateDoc.java
浏览文件 @
17712d53
...
@@ -61,8 +61,8 @@ public class GenerateDoc {
...
@@ -61,8 +61,8 @@ public class GenerateDoc {
bnf
=
Bnf
.
getInstance
(
null
);
bnf
=
Bnf
.
getInstance
(
null
);
session
.
put
(
"version"
,
Constants
.
getVersion
());
session
.
put
(
"version"
,
Constants
.
getVersion
());
session
.
put
(
"versionDate"
,
Constants
.
BUILD_DATE
);
session
.
put
(
"versionDate"
,
Constants
.
BUILD_DATE
);
session
.
put
(
"
previousVersion"
,
Constants
.
getVersionPrevious
());
session
.
put
(
"
stableVersion"
,
Constants
.
getVersionStable
());
session
.
put
(
"
previousVersionDate"
,
Constants
.
BUILD_DATE_PREVIOUS
);
session
.
put
(
"
stableVersionDate"
,
Constants
.
BUILD_DATE_STABLE
);
map
(
"commands"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION LIKE 'Commands%' ORDER BY ID"
);
map
(
"commands"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION LIKE 'Commands%' ORDER BY ID"
);
map
(
"commandsDML"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DML)' ORDER BY ID"
);
map
(
"commandsDML"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DML)' ORDER BY ID"
);
map
(
"commandsDDL"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DDL)' ORDER BY ID"
);
map
(
"commandsDDL"
,
"SELECT * FROM INFORMATION_SCHEMA.HELP WHERE SECTION='Commands (DDL)' ORDER BY ID"
);
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
17712d53
...
@@ -384,7 +384,7 @@ selling semicolon semmle send sending sends sense sensitive sensitivity sent
...
@@ -384,7 +384,7 @@ selling semicolon semmle send sending sends sense sensitive sensitivity sent
sentence sentinel sep sepang separate separated separately separating separator
sentence sentinel sep sepang separate separated separately separating separator
separators sept september seq sequence sequences sequential sequentially sequoia
separators sept september seq sequence sequences sequential sequentially sequoia
serial serializable serialization serialize serialized series serif server
serial serializable serialization serialize serialized series serif server
server
list server
s service services servicing servlet servlets sesar session
servers service services servicing servlet servlets sesar session
sessions set sets setter setters setting settings settlement setup several
sessions set sets setter setters setting settings settlement setup several
severity sftp sha shadow shall shallow share shared shares shell shellbook shift
severity sftp sha shadow shall shallow share shared shares shell shellbook shift
shipping short shorter shortest should shouldn show showing shown shows shrink
shipping short shorter shortest should shouldn show showing shown shows shrink
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论