Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9d35faf1
提交
9d35faf1
authored
6月 22, 2007
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
9ce12a7c
显示空白字符变更
内嵌
并排
正在显示
9 个修改的文件
包含
160 行增加
和
181 行删除
+160
-181
ant-build.properties
h2/ant-build.properties
+1
-1
build.xml
h2/build.xml
+1
-1
history.html
h2/src/docsrc/html/history.html
+5
-1
tutorial.html
h2/src/docsrc/html/tutorial.html
+4
-37
console.html
h2/src/tools/WEB-INF/console.html
+12
-7
web.xml
h2/src/tools/WEB-INF/web.xml
+49
-40
DbStarter.java
h2/src/tools/org/h2/server/web/DbStarter.java
+6
-2
WebServlet.java
h2/src/tools/org/h2/server/web/WebServlet.java
+81
-92
dictionary.txt
h2/src/tools/org/h2/tools/doc/dictionary.txt
+1
-0
没有找到文件。
h2/ant-build.properties
浏览文件 @
9d35faf1
...
...
@@ -2,5 +2,5 @@
javac
=
javac
benchmark.drivers.dir
=
D
\:
/data/java
version.name.maven
=
1.0.20070617
path.servlet.jar
=
C
\:
/data/classpath/servlet-api
-2.3
.jar
path.servlet.jar
=
C
\:
/data/classpath/servlet-api.jar
jdk
=
1.4
h2/build.xml
浏览文件 @
9d35faf1
...
...
@@ -273,7 +273,7 @@
</target>
<target
name=
"warConsole"
depends=
"compileServlet, jar"
>
<war
destfile=
"bin/h2console.war"
webxml=
"src/tools/WEB-INF/web.xml"
>
<war
destfile=
"bin/h2console.war"
webxml=
"src/tools/WEB-INF/web.xml"
basedir=
"src/tools/WEB-INF"
includes=
"console.html"
>
<lib
file=
"bin/h2.jar"
/>
</war>
</target>
...
...
h2/src/docsrc/html/history.html
浏览文件 @
9d35faf1
...
...
@@ -37,9 +37,13 @@ Hypersonic SQL or HSQLDB. H2 is built from scratch.
<h3>
Version 1.0 (Current)
</h3>
<h3>
Version 1.0 / TODO (Build TODO)
</h3><ul>
<li>
Deleting database files didn't work for Windows if the database was on the root directory of a drive.
<li>
The H2 Console can now be run as a standalone web application, or it can be embedded as a servlet into any
existing web application. To build the 'H2 Console' web application, execute 'ant warConsole'.
See src/tools/org/h2/server/web and src/tools/WEB-INF for details.
</li><li>
Deleting database files didn't work for Windows if the database was on the root directory of a drive.
</li><li>
The Polish translation is available. Thanks a lot to Tomek!
</li><li>
Windows service: the CLASSPATH was not included when starting the service. Fixed.
</li>
</ul>
<h3>
Version 1.0 / 2007-06-17 (Build 50)
</h3><ul>
...
...
h2/src/docsrc/html/tutorial.html
浏览文件 @
9d35faf1
...
...
@@ -314,48 +314,15 @@ bad if they don't get closed).
The server mode is similar, but it allows you to run the server in another process.
<h3>
Using a Servlet Listener to Start and Stop a Database
</h3>
Add the following to the web.xml file (after context-param and before filter):
Add the h2.jar file your web application, and
add the following snippet to your web.xml file (after context-param and before filter):
<pre>
<
listener>
<
listener-class>
db.
Starter
<
/listener-class>
<
listener-class>
org.h2.server.web.Db
Starter
<
/listener-class>
<
/listener>
</pre>
Add the following Starter class:
<pre>
package org.h2.tools.servlet;
import javax.servlet.*;
import java.sql.*;
public class DbStarter implements ServletContextListener {
private Connection conn;
public void contextInitialized(ServletContextEvent servletContextEvent) {
try {
Class.forName("org.h2.Driver");
// You can also get the setting from a context-param in web.xml:
// ServletContext servletContext = servletContextEvent.getServletContext();
// String url = servletContext.getInitParameter("db.url");
conn = DriverManager.getConnection("jdbc:h2:test", "sa", "");
} catch (Exception e) {
e.printStackTrace();
}
}
public Connection getConnection() {
return conn;
}
public void contextDestroyed(ServletContextEvent servletContextEvent) {
try {
conn.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
</pre>
For details on how to access the database, see the code DbStarter.java
<br
/><a
name=
"csv"
></a>
<h2>
CSV (Comma Separated Values) Support
</h2>
...
...
h2/src/tools/WEB-INF/console.html
浏览文件 @
9d35faf1
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html>
<head>
<title>
H2 Console
</title>
<META
HTTP-EQUIV=
"Refresh"
CONTENT=
"0; URL=console/"
>
<META
HTTP-EQUIV=
"Refresh"
CONTENT=
"0; URL=console/"
/
>
</head>
<body>
<a
href=
"console/"
>
H2 Console
</a>
...
...
h2/src/tools/WEB-INF/web.xml
浏览文件 @
9d35faf1
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<web-app
xmlns=
"http://java.sun.com/xml/ns/javaee"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation=
"http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
...
...
@@ -28,13 +32,16 @@
<welcome-file>
/console.html
</welcome-file>
</welcome-file-list>
<security-constraint>
<!-- Enable the following section when you want basic authentication -->
<!--
<security-constraint>
<web-resource-collection>
<web-resource-name>H2 Console</web-resource-name>
<url-pattern>/console/*</url-pattern>
</web-resource-collection>
-->
<auth-constraint>
<role-name>admin</role-name>
</auth-constraint>
...
...
@@ -49,4 +56,6 @@
<role-name>admin</role-name>
</security-role>
-->
</web-app>
h2/src/tools/org/h2/server/web/DbStarter.java
浏览文件 @
9d35faf1
/*
* Copyright 2004-2006 H2 Group. Licensed under the H2 License, Version 1.0 (http://h2database.com/html/license.html).
* Initial Developer: H2 Group
*/
package
org
.
h2
.
server
.
web
;
import
javax.servlet.*
;
...
...
@@ -9,7 +13,7 @@ public class DbStarter implements ServletContextListener {
public
void
contextInitialized
(
ServletContextEvent
servletContextEvent
)
{
try
{
Class
.
forName
(
"org.h2.Driver"
);
org
.
h2
.
Driver
.
load
(
);
// You can also get the setting from a context-param in web.xml:
ServletContext
servletContext
=
servletContextEvent
.
getServletContext
();
// String url = servletContext.getInitParameter("db.url");
...
...
h2/src/tools/org/h2/server/web/WebServlet.java
浏览文件 @
9d35faf1
...
...
@@ -26,13 +26,10 @@ public class WebServlet extends HttpServlet {
private
static
final
long
serialVersionUID
=
9171446624885086692L
;
private
WebServer
server
;
private
void
testLog
(
String
s
)
{
int
todoRefactorSimplify
;
int
todoRemoveTestLogMethod
;
int
todoTestWithTomcat
;
int
todoTestWithJetty
;
System
.
out
.
println
(
s
);
}
private
int
todoRefactorRemoveDuplicateCode
;
private
int
todoRemoveSystem_out
;
private
int
todoTestWithTomcat
;
private
int
todoTestWithJetty
;
public
void
init
()
throws
ServletException
{
ServletConfig
config
=
getServletConfig
();
...
...
@@ -77,7 +74,6 @@ public class WebServlet extends HttpServlet {
protected
void
doGet
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
IOException
{
String
file
=
req
.
getPathInfo
();
trace
(
"get "
+
file
);
if
(
file
==
null
)
{
resp
.
sendRedirect
(
req
.
getRequestURI
()
+
"/"
);
return
;
...
...
@@ -101,7 +97,7 @@ public class WebServlet extends HttpServlet {
en
=
req
.
getParameterNames
();
while
(
en
.
hasMoreElements
())
{
String
name
=
(
String
)
en
.
nextElement
();
String
value
=
(
String
)
req
.
getParameter
(
name
);
String
value
=
req
.
getParameter
(
name
);
attributes
.
put
(
name
,
value
);
}
WebSession
session
=
null
;
...
...
@@ -109,7 +105,6 @@ public class WebServlet extends HttpServlet {
if
(
sessionId
!=
null
)
{
session
=
server
.
getSession
(
sessionId
);
}
int
todoSupportCache
;
String
mimeType
;
boolean
cache
;
int
index
=
file
.
lastIndexOf
(
'.'
);
...
...
@@ -129,7 +124,7 @@ public class WebServlet extends HttpServlet {
cache
=
true
;
mimeType
=
"text/css"
;
}
else
if
(
suffix
.
equals
(
"html"
)
||
suffix
.
equals
(
"do"
)
||
suffix
.
equals
(
"jsp"
))
{
cache
=
false
;
cache
=
false
;
mimeType
=
"text/html"
;
if
(
session
==
null
)
{
int
todoTest
;
...
...
@@ -140,7 +135,7 @@ public class WebServlet extends HttpServlet {
}
}
}
else
if
(
suffix
.
equals
(
"js"
))
{
cache
=
true
;
cache
=
true
;
mimeType
=
"text/javascript"
;
}
else
{
cache
=
false
;
...
...
@@ -151,7 +146,6 @@ public class WebServlet extends HttpServlet {
server
.
trace
(
"mimeType="
+
mimeType
);
// parseHeader();
String
ifModifiedSince
=
req
.
getHeader
(
"if-modified-since"
);
testLog
(
"@ifmod="
+
ifModifiedSince
);
server
.
trace
(
file
);
WebThread
app
=
new
WebThread
(
null
,
server
);
...
...
@@ -160,8 +154,8 @@ public class WebServlet extends HttpServlet {
file
=
app
.
process
(
file
);
}
if
(
cache
&&
server
.
getStartDateTime
().
equals
(
ifModifiedSince
))
{
resp
.
sendError
(
HttpServletResponse
.
SC_NOT_MODIFIED
);
bytes
=
null
;
resp
.
setStatus
(
HttpServletResponse
.
SC_NOT_MODIFIED
);
return
;
}
else
{
bytes
=
server
.
getFile
(
file
);
}
...
...
@@ -196,11 +190,6 @@ public class WebServlet extends HttpServlet {
}
}
private
void
trace
(
String
s
)
{
int
todo
;
System
.
out
.
println
(
"## "
+
s
);
}
protected
void
doPost
(
HttpServletRequest
req
,
HttpServletResponse
resp
)
throws
IOException
{
doGet
(
req
,
resp
);
}
...
...
h2/src/tools/org/h2/tools/doc/dictionary.txt
浏览文件 @
9d35faf1
...
...
@@ -458,6 +458,7 @@ maxvalue samooha dbrewster minvalue darwin follow graphics typically
netscape mywebpage javaplayer fuse davidlbarron helps player appfuse awt
gridwidth editable pressed entered awt east toolkit insets exited grid mouse west resizable popup focusable bag anchor
headless
polish javaee resp xsi instances tomek realm xsd appended auth polski
### check those again:
populate slowly xacon inser maxbqualsize counter regards attaching official xatest
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论