Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
74108a40
提交
74108a40
authored
2月 01, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
7c091a02
全部展开
显示空白字符变更
内嵌
并排
正在显示
17 个修改的文件
包含
373 行增加
和
353 行删除
+373
-353
MetaTable.java
h2/src/main/org/h2/table/MetaTable.java
+4
-3
Backup.java
h2/src/main/org/h2/tools/Backup.java
+6
-6
ChangePassword.java
h2/src/main/org/h2/tools/ChangePassword.java
+7
-7
ConvertTraceFile.java
h2/src/main/org/h2/tools/ConvertTraceFile.java
+4
-4
CreateCluster.java
h2/src/main/org/h2/tools/CreateCluster.java
+3
-3
Csv.java
h2/src/main/org/h2/tools/Csv.java
+3
-3
DeleteDbFiles.java
h2/src/main/org/h2/tools/DeleteDbFiles.java
+4
-4
Recover.java
h2/src/main/org/h2/tools/Recover.java
+4
-4
RunScript.java
h2/src/main/org/h2/tools/RunScript.java
+7
-7
Server.java
h2/src/main/org/h2/tools/Server.java
+25
-25
Newsfeed.java
h2/src/test/org/h2/samples/Newsfeed.java
+3
-0
newsfeed.sql
h2/src/test/org/h2/samples/newsfeed.sql
+259
-267
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+25
-5
GenerateDoc.java
h2/src/tools/org/h2/tools/doc/GenerateDoc.java
+6
-2
MergeDocs.java
h2/src/tools/org/h2/tools/doc/MergeDocs.java
+2
-2
XMLChecker.java
h2/src/tools/org/h2/tools/doc/XMLChecker.java
+3
-3
Doclet.java
h2/src/tools/org/h2/tools/doclet/Doclet.java
+8
-8
没有找到文件。
h2/src/main/org/h2/table/MetaTable.java
浏览文件 @
74108a40
...
...
@@ -1006,13 +1006,14 @@ public class MetaTable extends Table {
}
String
columnList
=
null
;
if
(
columns
!=
null
)
{
columnList
=
""
;
StringBuffer
buff
=
new
StringBuffer
()
;
for
(
int
j
=
0
;
j
<
columns
.
length
;
j
++)
{
if
(
j
>
0
)
{
columnList
+=
","
;
buff
.
append
(
','
)
;
}
columnList
+=
columns
[
j
].
getName
(
);
buff
.
append
(
columns
[
j
].
getName
()
);
}
columnList
=
buff
.
toString
();
}
add
(
rows
,
new
String
[]
{
catalog
,
// CONSTRAINT_CATALOG
...
...
h2/src/main/org/h2/tools/Backup.java
浏览文件 @
74108a40
...
...
@@ -37,12 +37,12 @@ public class Backup {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-url jdbc:h2:... (database URL)
* <li>-user username
* <li>-password password
* <li>-script filename (default file name is backup.sql)
* <li>-options to specify a list of options (only for H2)
* </ul>
* <
/li><
li>-url jdbc:h2:... (database URL)
* <
/li><
li>-user username
* <
/li><
li>-password password
* <
/li><
li>-script filename (default file name is backup.sql)
* <
/li><
li>-options to specify a list of options (only for H2)
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/main/org/h2/tools/ChangePassword.java
浏览文件 @
74108a40
...
...
@@ -39,13 +39,13 @@ public class ChangePassword extends FileBase {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-cipher type (AES or XTEA)
* <li>-decrypt password (null if the database is not encrypted)
* <li>-encrypt password (null if the database should not be encrypted)
* <li>-quiet does not print progress information
* </ul>
* <
/li><
li>-dir directory (the default is the current directory)
* <
/li><
li>-db databaseName (all databases if no name is specified)
* <
/li><
li>-cipher type (AES or XTEA)
* <
/li><
li>-decrypt password (null if the database is not encrypted)
* <
/li><
li>-encrypt password (null if the database should not be encrypted)
* <
/li><
li>-quiet does not print progress information
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/main/org/h2/tools/ConvertTraceFile.java
浏览文件 @
74108a40
...
...
@@ -30,10 +30,10 @@ public class ConvertTraceFile {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-traceFile filename (the default is test.trace.db)
* <li>-script filename (the default is test.sql)
* <li>-javaClass className (the default is Test)
* </ul>
* <
/li><
li>-traceFile filename (the default is test.trace.db)
* <
/li><
li>-script filename (the default is test.sql)
* <
/li><
li>-javaClass className (the default is Test)
* </
li></
ul>
*
* @param args the command line arguments
* @throws Exception
...
...
h2/src/main/org/h2/tools/CreateCluster.java
浏览文件 @
74108a40
...
...
@@ -31,9 +31,9 @@ public class CreateCluster {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-urlSource jdbc:h2:... (the database URL of the source database)
* <li>-urlTarget jdbc:h2:... (the database URL of the target database)
* </ul>
* <
/li><
li>-urlSource jdbc:h2:... (the database URL of the source database)
* <
/li><
li>-urlTarget jdbc:h2:... (the database URL of the target database)
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/main/org/h2/tools/Csv.java
浏览文件 @
74108a40
...
...
@@ -107,7 +107,7 @@ public class Csv implements SimpleRowSource {
columnNames
=
colNames
;
initRead
();
SimpleResultSet
result
=
new
SimpleResultSet
(
this
);
normalizeColumnNames
();
makeColumnNamesUnique
();
for
(
int
i
=
0
;
i
<
columnNames
.
length
;
i
++)
{
result
.
addColumn
(
columnNames
[
i
],
Types
.
VARCHAR
,
255
,
0
);
}
...
...
@@ -135,7 +135,7 @@ public class Csv implements SimpleRowSource {
this
.
reader
=
reader
;
initRead
();
SimpleResultSet
result
=
new
SimpleResultSet
(
this
);
normalizeColumnNames
();
makeColumnNamesUnique
();
for
(
int
i
=
0
;
i
<
columnNames
.
length
;
i
++)
{
result
.
addColumn
(
columnNames
[
i
],
Types
.
VARCHAR
,
255
,
0
);
}
...
...
@@ -145,7 +145,7 @@ public class Csv implements SimpleRowSource {
}
}
private
void
normalizeColumnNames
()
{
private
void
makeColumnNamesUnique
()
{
for
(
int
i
=
0
;
i
<
columnNames
.
length
;
i
++)
{
String
x
=
columnNames
[
i
];
if
(
x
==
null
||
x
.
length
()==
0
)
{
...
...
h2/src/main/org/h2/tools/DeleteDbFiles.java
浏览文件 @
74108a40
...
...
@@ -29,10 +29,10 @@ public class DeleteDbFiles extends FileBase {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-quiet does not print progress information
* </ul>
* <
/li><
li>-dir directory (the default is the current directory)
* <
/li><
li>-db databaseName (all databases if no name is specified)
* <
/li><
li>-quiet does not print progress information
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/main/org/h2/tools/Recover.java
浏览文件 @
74108a40
...
...
@@ -74,10 +74,10 @@ public class Recover implements DataHandler {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-dir directory (the default is the current directory)
* <li>-db databaseName (all databases if no name is specified)
* <li>-log {true|false} (log additional messages)
* </ul>
* <
/li><
li>-dir directory (the default is the current directory)
* <
/li><
li>-db databaseName (all databases if no name is specified)
* <
/li><
li>-log {true|false} (log additional messages)
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/main/org/h2/tools/RunScript.java
浏览文件 @
74108a40
...
...
@@ -44,13 +44,13 @@ public class RunScript {
* following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-url jdbc:h2:... (database URL)
* <li>-user username
* <li>-password password
* <li>-script filename (default file name is backup.sql)
* <li>-driver driver the JDBC driver class name (not required for H2)
* <li>-options to specify a list of options (only for H2 and only when using the embedded mode)
* </ul>
* <
/li><
li>-url jdbc:h2:... (database URL)
* <
/li><
li>-user username
* <
/li><
li>-password password
* <
/li><
li>-script filename (default file name is backup.sql)
* <
/li><
li>-driver driver the JDBC driver class name (not required for H2)
* <
/li><
li>-options to specify a list of options (only for H2 and only when using the embedded mode)
* </
li></
ul>
* To include local files when using remote databases, use the special syntax:
* <pre>
* @INCLUDE fileName
...
...
h2/src/main/org/h2/tools/Server.java
浏览文件 @
74108a40
...
...
@@ -72,34 +72,34 @@ public class Server implements Runnable {
* The following options are supported:
* <ul>
* <li>-help or -? (print the list of options)
* <li>-web (start the Web Server)
* <li>-tcp (start the TCP Server)
* <li>-tcpShutdown {url} (shutdown the running TCP Server, URL example: tcp://localhost:9094)
* <li>-odbc (start the ODBC Server)
* <li>-browser (start a browser and open a page to connect to the Web Server)
* <li>-log [true|false] (enable or disable logging)
* <li>-baseDir {directory} (sets the base directory for database files)
* <li>-ifExists [true|false] (only existing databases may be opened)
* <li>-ftp (start the FTP Server)
* </ul>
* <
/li><
li>-web (start the Web Server)
* <
/li><
li>-tcp (start the TCP Server)
* <
/li><
li>-tcpShutdown {url} (shutdown the running TCP Server, URL example: tcp://localhost:9094)
* <
/li><
li>-odbc (start the ODBC Server)
* <
/li><
li>-browser (start a browser and open a page to connect to the Web Server)
* <
/li><
li>-log [true|false] (enable or disable logging)
* <
/li><
li>-baseDir {directory} (sets the base directory for database files)
* <
/li><
li>-ifExists [true|false] (only existing databases may be opened)
* <
/li><
li>-ftp (start the FTP Server)
* </
li></
ul>
* For each Server, there are additional options available:
* <ul>
* <li>-webPort {port} (the port of Web Server, default: 8082)
* <li>-webSSL [true|false] (if SSL should be used)
* <li>-webAllowOthers [true|false] (enable/disable remote connections)
* <li>-tcpPort {port} (the port of TCP Server, default: 9092)
* <li>-tcpSSL [true|false] (if SSL should be used)
* <li>-tcpAllowOthers [true|false] (enable/disable remote connections)
* <li>-tcpPassword {password} (the password for shutting down a TCP Server)
* <li>-tcpShutdownForce [true|false] (don't wait for other connections to close)
* <li>-odbcPort {port} (the port of ODBC Server, default: 9083)
* <li>-odbcAllowOthers [true|false] (enable/disable remote connections)
* <li>-ftpPort {port}
* <li>-ftpDir {directory}
* <li>-ftpRead {readUserName}
* <li>-ftpWrite {writeUserName}
* <li>-ftpWritePassword {password}
* </ul>
* <
/li><
li>-webSSL [true|false] (if SSL should be used)
* <
/li><
li>-webAllowOthers [true|false] (enable/disable remote connections)
* <
/li><
li>-tcpPort {port} (the port of TCP Server, default: 9092)
* <
/li><
li>-tcpSSL [true|false] (if SSL should be used)
* <
/li><
li>-tcpAllowOthers [true|false] (enable/disable remote connections)
* <
/li><
li>-tcpPassword {password} (the password for shutting down a TCP Server)
* <
/li><
li>-tcpShutdownForce [true|false] (don't wait for other connections to close)
* <
/li><
li>-odbcPort {port} (the port of ODBC Server, default: 9083)
* <
/li><
li>-odbcAllowOthers [true|false] (enable/disable remote connections)
* <
/li><
li>-ftpPort {port}
* <
/li><
li>-ftpDir {directory}
* <
/li><
li>-ftpRead {readUserName}
* <
/li><
li>-ftpWrite {writeUserName}
* <
/li><
li>-ftpWritePassword {password}
* </
li></
ul>
*
* @param args the command line arguments
* @throws SQLException
...
...
h2/src/test/org/h2/samples/Newsfeed.java
浏览文件 @
74108a40
...
...
@@ -45,9 +45,12 @@ public class Newsfeed {
s
=
StringUtils
.
replaceAll
(
s
,
"<ul>"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"</ul>"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"<li>"
,
"- "
);
s
=
StringUtils
.
replaceAll
(
s
,
"</li>"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"<a href=\""
,
"( "
);
s
=
StringUtils
.
replaceAll
(
s
,
"\">"
,
" ) "
);
s
=
StringUtils
.
replaceAll
(
s
,
"</a>"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"<br />"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"<br/>"
,
""
);
s
=
StringUtils
.
replaceAll
(
s
,
"<br>"
,
""
);
if
(
s
.
indexOf
(
'<'
)
>=
0
||
s
.
indexOf
(
'>'
)
>=
0
)
{
throw
new
Error
(
"Unsupported HTML Tag: < or > in "
+
s
);
...
...
h2/src/test/org/h2/samples/newsfeed.sql
浏览文件 @
74108a40
差异被折叠。
点击展开。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
74108a40
...
...
@@ -86,6 +86,31 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
TestAll
test
=
new
TestAll
();
test
.
printSystem
();
// improve TestHalt
// TODO backup : lobs are not backed up
// DROP TABLE IF EXISTS TEST;
// CREATE TABLE TEST(ID INT PRIMARY KEY, DATA CLOB);
// INSERT INTO TEST VALUES(1, space(10000));
// INSERT INTO TEST VALUES(2, 'World');
// drop table bar;
// drop table foo;
// create table FOO(id integer primary key);
// create table BAR(fooId integer);
// alter table bar add foreign key (fooid) references foo (id);
// truncate table bar;
// drop table FOO;
// create table FOO (ID int, A number(18, 2));
// insert into FOO (ID, A) values (1, 10.0), (2, 20.0);
// select SUM (CASE when ID=1 then 0 ELSE A END) col0 from Foo;
// hot backup: test, test encrypted database
// BACKUP: compare sql syntax with other databases
// Hot backup (incremental backup, online backup): backup data, log, index? files
// h2
// update FOO set a = dateadd('second', 4320000, a);
// ms sql server
...
...
@@ -100,11 +125,6 @@ java -Xmx512m -Xrunhprof:cpu=samples,depth=8 org.h2.tools.RunScript -url jdbc:h2
// test backup
// backup: lobs, index
// improve TestHalt
// BACKUP: compare sql syntax with other databases
// Hot backup (incremental backup, online backup): backup data, log, index? files
// GroovyServlet
// Cluster: hot deploy (adding a node on runtime)
...
...
h2/src/tools/org/h2/tools/doc/GenerateDoc.java
浏览文件 @
74108a40
...
...
@@ -11,6 +11,7 @@ import java.sql.Connection;
import
java.sql.DriverManager
;
import
java.sql.ResultSet
;
import
java.sql.ResultSetMetaData
;
import
java.sql.Statement
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -82,8 +83,10 @@ public class GenerateDoc {
void
map
(
String
key
,
String
sql
)
throws
Exception
{
ResultSet
rs
=
null
;
Statement
stat
=
null
;
try
{
rs
=
conn
.
createStatement
().
executeQuery
(
sql
);
stat
=
conn
.
createStatement
();
rs
=
stat
.
executeQuery
(
sql
);
ArrayList
list
=
new
ArrayList
();
while
(
rs
.
next
())
{
HashMap
map
=
new
HashMap
();
...
...
@@ -96,7 +99,7 @@ public class GenerateDoc {
String
topic
=
rs
.
getString
(
"TOPIC"
);
String
syntax
=
rs
.
getString
(
"SYNTAX"
);
syntax
=
PageParser
.
escapeHtml
(
syntax
);
syntax
=
StringUtils
.
replaceAll
(
syntax
,
"<br>"
,
""
);
syntax
=
StringUtils
.
replaceAll
(
syntax
,
"<br
/
>"
,
""
);
syntax
=
bnf
.
getSyntax
(
topic
,
syntax
);
map
.
put
(
"syntax"
,
syntax
);
list
.
add
(
map
);
...
...
@@ -104,6 +107,7 @@ public class GenerateDoc {
session
.
put
(
key
,
list
);
}
finally
{
JdbcUtils
.
closeSilently
(
rs
);
JdbcUtils
.
closeSilently
(
stat
);
}
}
}
h2/src/tools/org/h2/tools/doc/MergeDocs.java
浏览文件 @
74108a40
...
...
@@ -47,9 +47,9 @@ public class MergeDocs {
String
finalText
=
buff
.
toString
();
File
output
=
new
File
(
baseDir
,
"onePage.html"
);
PrintWriter
writer
=
new
PrintWriter
(
new
FileWriter
(
output
));
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><title>"
);
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"
/
><title>"
);
writer
.
println
(
"H2 Documentation"
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheetPdf.css\"></head><body>"
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheetPdf.css\"
/
></head><body>"
);
writer
.
println
(
finalText
);
writer
.
println
(
"</body></html>"
);
writer
.
close
();
...
...
h2/src/tools/org/h2/tools/doc/XMLChecker.java
浏览文件 @
74108a40
...
...
@@ -89,9 +89,9 @@ public class XMLChecker {
private
static
void
checkXML
(
String
xml
,
boolean
html
)
throws
Exception
{
String
lastElement
=
null
;
String
[]
noClose
=
new
String
[]{
"li"
,
"link"
,
"meta"
,
"br"
,
"img"
,
"input"
,
"hr"
,
"frame"
};
// <li>: replace <li>([^\r]*[^<]*) with <li>$1</li>
// use this for html file, for example if <li> is not closed
String
[]
noClose
=
new
String
[]{
};
XMLParser
parser
=
new
XMLParser
(
xml
);
Stack
stack
=
new
Stack
();
boolean
rootElement
=
false
;
...
...
h2/src/tools/org/h2/tools/doclet/Doclet.java
浏览文件 @
74108a40
...
...
@@ -55,13 +55,13 @@ public class Doclet {
FileWriter
out
=
new
FileWriter
(
fileName
);
PrintWriter
writer
=
new
PrintWriter
(
new
BufferedWriter
(
out
));
writer
.
println
(
"<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"
);
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"><title>"
);
writer
.
println
(
"<html><head><meta http-equiv=\"Content-Type\" content=\"text/html;charset=utf-8\"
/
><title>"
);
writer
.
println
(
className
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\"></head><body>"
);
writer
.
println
(
"</title><link rel=\"stylesheet\" type=\"text/css\" href=\"../../../stylesheet.css\"
/
></head><body>"
);
writer
.
println
(
"<table class=\"content\"><tr class=\"content\"><td class=\"content\"><div class=\"contentDiv\">"
);
writer
.
println
(
"<h1>"
+
className
+
"</h1>"
);
writer
.
println
(
clazz
.
commentText
()+
"<br
><br
>"
);
writer
.
println
(
clazz
.
commentText
()+
"<br
/><br /
>"
);
MethodDoc
[]
methods
=
clazz
.
methods
();
Arrays
.
sort
(
methods
,
new
Comparator
()
{
...
...
@@ -117,7 +117,7 @@ public class Doclet {
continue
;
}
if
(
fieldId
==
0
)
{
writer
.
println
(
"<br><table><tr><th colspan=\"2\">Fields</th></tr>"
);
writer
.
println
(
"<br
/
><table><tr><th colspan=\"2\">Fields</th></tr>"
);
}
String
name
=
field
.
name
();
String
type
=
getTypeName
(
true
,
field
.
type
());
...
...
@@ -174,7 +174,7 @@ public class Doclet {
boolean
space
=
false
;
for
(
int
j
=
0
;
j
<
paramTags
.
length
;
j
++)
{
if
(!
space
)
{
writer
.
println
(
"<br
><br
>"
);
writer
.
println
(
"<br
/><br /
>"
);
space
=
true
;
}
String
p
=
paramTags
[
j
].
parameterName
()
+
" - "
+
paramTags
[
j
].
parameterComment
();
...
...
@@ -186,7 +186,7 @@ public class Doclet {
Tag
[]
returnTags
=
method
.
tags
(
"return"
);
if
(
returnTags
!=
null
&&
returnTags
.
length
>
0
)
{
if
(!
space
)
{
writer
.
println
(
"<br
><br
>"
);
writer
.
println
(
"<br
/><br /
>"
);
space
=
true
;
}
writer
.
println
(
"<div class=\"itemTitle\">Returns:</div>"
);
...
...
@@ -195,7 +195,7 @@ public class Doclet {
ThrowsTag
[]
throwsTags
=
method
.
throwsTags
();
if
(
throwsTags
!=
null
&&
throwsTags
.
length
>
0
)
{
if
(!
space
)
{
writer
.
println
(
"<br
><br
>"
);
writer
.
println
(
"<br
/><br /
>"
);
space
=
true
;
}
writer
.
println
(
"<div class=\"itemTitle\">Throws:</div>"
);
...
...
@@ -208,7 +208,7 @@ public class Doclet {
writer
.
println
(
"<div class=\"item\">"
+
p
+
"</div>"
);
}
}
writer
.
println
(
"<hr>"
);
writer
.
println
(
"<hr
/
>"
);
}
writer
.
println
(
"</div></td></tr></table></body></html>"
);
writer
.
close
();
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论