Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
9f7ca082
提交
9f7ca082
authored
7月 31, 2008
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
--no commit message
--no commit message
上级
c0c73bcb
全部展开
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
1768 行增加
和
1403 行删除
+1768
-1403
changelog.html
h2/src/docsrc/html/changelog.html
+4
-1
faq.html
h2/src/docsrc/html/faq.html
+1
-0
jaqu.html
h2/src/docsrc/html/jaqu.html
+205
-0
links.html
h2/src/docsrc/html/links.html
+5
-0
search.html
h2/src/docsrc/html/search.html
+1
-0
_docs_en.utf8.txt
h2/src/docsrc/text/_docs_en.utf8.txt
+528
-465
_docs_ja.utf8.txt
h2/src/docsrc/text/_docs_ja.utf8.txt
+528
-465
_docs_en.properties
h2/src/docsrc/textbase/_docs_en.properties
+488
-467
TestAll.java
h2/src/test/org/h2/test/TestAll.java
+2
-2
supportTemplates.txt
h2/src/test/org/h2/test/todo/supportTemplates.txt
+4
-2
dictionary.txt
h2/src/tools/org/h2/build/doc/dictionary.txt
+2
-1
没有找到文件。
h2/src/docsrc/html/changelog.html
浏览文件 @
9f7ca082
...
...
@@ -16,7 +16,10 @@ Change Log
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Oracle compatibility: old style outer join syntax using (+) did work correctly sometimes.
<ul><li>
MySQL compatibility: linked tables had lower case column names on some systems.
</li><li>
DB2 compatibility: the DB2 fetch-first-clause is supported.
</li><li>
Oracle compatibility: old style outer join syntax using (+) did work correctly sometimes.
</li><li>
ResultSet.setFetchSize is now supported.
</li></ul>
<h2>
Version 1.0.76 (2008-07-27)
</h2>
...
...
h2/src/docsrc/html/faq.html
浏览文件 @
9f7ca082
...
...
@@ -125,6 +125,7 @@ to be dangerous by design, and some problems are hard to solve. Those are:
<li>
Using SET LOG 0 to disable the transaction log file.
</li><li>
Using the transaction isolation level READ_UNCOMMITTED (LOCK_MODE 0) while at the same time using multiple
connections may result in inconsistent transactions.
</li><li>
Using FILE_LOCK=NO in the database URL.
</li></ul>
<p>
In addition to that, running out of memory should be avoided.
...
...
h2/src/docsrc/html/jaqu.html
0 → 100644
浏览文件 @
9f7ca082
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Copyright 2004-2008 H2 Group. Multiple-Licensed under the H2 License, Version 1.0,,
and under the Eclipse Public License, Version 1.0
(http://h2database.com/html/license.html).
Initial Developer: H2 Group
-->
<html
xmlns=
"http://www.w3.org/1999/xhtml"
lang=
"en"
xml:lang=
"en"
>
<head><meta
http-equiv=
"Content-Type"
content=
"text/html;charset=utf-8"
/><title>
JaQu
</title><link
rel=
"stylesheet"
type=
"text/css"
href=
"stylesheet.css"
/>
<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>
JaQu
</h1>
<h2>
What is JaQu
</h2>
<p>
JaQu stands for Java Query and allows to access databases using pure Java.
JaQu replaces SQL, JDBC, and O/R frameworks such as Hibernate.
JaQu is something like LINQ for Java (LINQ stands for "language integrated query" and is a
Microsoft .NET technology). The following JaQu code:
</p>
<pre>
Product p = new Product();
List
<
Product> soldOutProducts =
db.from(p).where(p.unitsInStock).is(0).select();
</pre>
<p>
stands for the SQL statement:
</p>
<pre>
SELECT * FROM PRODUCTS P
WHERE P.UNITS_IN_STOCK = 0
</pre>
<h2>
Advantages
</h2>
<p>
Unlike to SQL, JaQu can be easily integrated in Java applications. Because JaQu is pure Java,
Javadoc and auto-complete are supported. Type checking is performed by the compiler.
JaQu fully protects against SQL injection.
</p>
<h3>
Why in Java?
</h3>
<p>
Most people use Java in their application. Mixing Java and another language (for example Scala or Groovy)
in the same application is complicated. It would be required to split the code to access the database
and the application code.
</p>
<h2>
Current State
</h2>
<p>
JaQu is not yet stable, and not part of the h2.jar file. However the source code is included in H2,
under:
</p>
<ul><li>
src/test/org/h2/test/jaqu/* (samples and tests)
</li><li>
src/tools/org/h2/jaqu/* (framework)
</li></ul>
<h2>
Requirements
</h2>
<p>
JaQu requires Java 1.5. Annotations are not need.
Currently, JaQu is only tested with the H2 database engine, however in theory it should
work with any database that supports the JDBC API.
</p>
<h2>
Example Code
</h2>
<pre>
package org.h2.test.jaqu;
import java.math.BigDecimal;
import java.util.List;
import org.h2.jaqu.Db;
import static org.h2.jaqu.Function.*;
public class Test {
Db db;
public static void main(String[] args) throws Exception {
new SamplesTest().test();
}
public void test() throws Exception {
db = Db.open("jdbc:h2:mem:", "sa", "sa");
db.insertAll(Product.getProductList());
db.insertAll(Customer.getCustomerList());
db.insertAll(Order.getOrderList());
testLength();
testCount();
testGroup();
testSelectManyCompoundFrom2();
testWhereSimple4();
testSelectSimple2();
testAnonymousTypes3();
testWhereSimple2();
testWhereSimple3();
db.close();
}
private void testWhereSimple2() throws Exception {
Product p = new Product();
List
<
Product> soldOutProducts =
db.from(p).
where(p.unitsInStock).is(0).
orderBy(p.productId).select();
}
private void testWhereSimple3() throws Exception {
Product p = new Product();
List
<
Product> expensiveInStockProducts =
db.from(p).
where(p.unitsInStock).bigger(0).
and(p.unitPrice).bigger(3.0).
orderBy(p.productId).select();
}
private void testWhereSimple4() throws Exception {
Customer c = new Customer();
List
<
Customer> waCustomers =
db.from(c).
where(c.region).is("WA").
select();
}
private void testSelectSimple2() throws Exception {
Product p = new Product();
List
<
String> productNames =
db.from(p).
orderBy(p.productId).select(p.productName);
List
<
Product> products = Product.getProductList();
}
public static class ProductPrice {
public String productName;
public String category;
public Double price;
}
private void testAnonymousTypes3() throws Exception {
final Product p = new Product();
List
<
ProductPrice> productInfos =
db.from(p).orderBy(p.productId).
select(new ProductPrice() { {
productName = p.productName;
category = p.category;
price = p.unitPrice;
}});
List
<
Product> products = Product.getProductList();
}
public static class CustOrder {
public String customerId;
public Integer orderId;
public BigDecimal total;
}
private void testSelectManyCompoundFrom2() throws Exception {
final Customer c = new Customer();
final Order o = new Order();
List
<
CustOrder> orders =
db.from(c).
innerJoin(o).on(c.customerId).is(o.customerId).
where(o.total).smaller(new BigDecimal("500.00")).
orderBy(1).
select(new CustOrder() { {
customerId = c.customerId;
orderId = o.orderId;
total = o.total;
}});
}
private void testLength() throws Exception {
Product p = new Product();
List
<
Integer> lengths = db.from(p).
where(length(p.productName)).smaller(10).
orderBy(1).
selectDistinct(length(p.productName));
}
private void testCount() throws Exception {
long count = db.from(new Product()).selectCount();
}
public static class ProductGroup {
public String category;
public Long productCount;
}
private void testGroup() throws Exception {
final Product p = new Product();
List
<
ProductGroup> list =
db.from(p).
groupBy(p.category).
orderBy(1).
select(new ProductGroup() { {
category = p.category;
productCount = count();
}});
}
}
</pre>
</div></td></tr></table>
<!-- analytics -->
</body></html>
h2/src/docsrc/html/links.html
浏览文件 @
9f7ca082
...
...
@@ -140,6 +140,11 @@ HA-JDBC</a><br />
High-Availability JDBC: A JDBC proxy that provides light-weight, transparent, fault tolerant clustering capability to any underlying JDBC driver.
</p>
<p><a
href=
"http://coolharbor.100free.com/index.htm"
>
Harbor
</a><br
/>
Pojo Application Server.
</p>
<p><a
href=
"http://henplus.sourceforge.net"
>
HenPlus
</a><br
/>
HenPlus is a SQL shell written in Java.
...
...
h2/src/docsrc/html/search.html
浏览文件 @
9f7ca082
...
...
@@ -60,6 +60,7 @@ Initial Developer: H2 Group
<a
href=
"features.html"
target=
"main"
>
Features
</a><br
/>
<a
href=
"performance.html"
target=
"main"
>
Performance
</a><br
/>
<a
href=
"advanced.html"
target=
"main"
>
Advanced Topics
</a><br
/>
<a
href=
"jaqu.html"
target=
"main"
>
JaQu
</a><br
/>
<a
href=
"download.html"
target=
"main"
>
Download
</a><br
/>
<br
/>
<b>
Reference
</b><br
/>
...
...
h2/src/docsrc/text/_docs_en.utf8.txt
浏览文件 @
9f7ca082
差异被折叠。
点击展开。
h2/src/docsrc/text/_docs_ja.utf8.txt
浏览文件 @
9f7ca082
差异被折叠。
点击展开。
h2/src/docsrc/textbase/_docs_en.properties
浏览文件 @
9f7ca082
差异被折叠。
点击展开。
h2/src/test/org/h2/test/TestAll.java
浏览文件 @
9f7ca082
...
...
@@ -271,8 +271,8 @@ java org.h2.test.TestAll timer
/*
Improved compatibility with DB2: support for FETCH .. ROWS
GRANT SELECT, UPDATE ON *
Check Eclipse DTP, see also
https://bugs.eclipse.org/bugs/show_bug.cgi?id=137701
...
...
h2/src/test/org/h2/test/todo/supportTemplates.txt
浏览文件 @
9f7ca082
...
...
@@ -37,9 +37,11 @@ I am sorry to say that, but it looks like a corruption problem. I am very intere
- Could you send the full stack trace of the exception including message text?
- What is your database URL?
- You can find out if the database is corrupted when running SCRIPT TO 'test.sql'
- You can find out if the database is corrupted when running
SCRIPT TO 'test.sql'
- What version H2 are you using?
- With which version of H2 was this database created? You can find it out using:
- With which version of H2 was this database created?
You can find it out using:
select * from information_schema.settings where name='CREATE_BUILD'
- Did you use multiple connections?
- The first workarounds is: append ;RECOVER=1 to the database URL.
...
...
h2/src/tools/org/h2/build/doc/dictionary.txt
浏览文件 @
9f7ca082
...
...
@@ -551,4 +551,5 @@ geocoder geocoding longitude estimating microarray latitude magnolia pfgrc
refill analyzers patches popular came growing indication arabic graphic toc
numbering goto outline makensis macro hyperlink dispatch setlocal wend
widows msgbox designer styles families uno soffice orphans stan ucb rem
pdfurl upate pagebreak ren echo atlassian buggy submitted xcopy
pdfurl upate pagebreak ren echo atlassian buggy submitted xcopy invention
harbor generics pojo annotations
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论