Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
e979821e
提交
e979821e
authored
3月 06, 2018
作者:
Evgenij Ryazanov
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Java 7 and Android load drivers from META-INF/services/java.sql.Driver
上级
f585c6e9
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
1 行增加
和
9 行删除
+1
-9
advanced.html
h2/src/docsrc/html/advanced.html
+0
-2
cheatSheet.html
h2/src/docsrc/html/cheatSheet.html
+0
-1
faq.html
h2/src/docsrc/html/faq.html
+0
-1
features.html
h2/src/docsrc/html/features.html
+0
-1
tutorial.html
h2/src/docsrc/html/tutorial.html
+1
-4
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
e979821e
...
@@ -1065,7 +1065,6 @@ import java.sql.*;
...
@@ -1065,7 +1065,6 @@ import java.sql.*;
import java.util.*;
import java.util.*;
public class Test {
public class Test {
public static void main(String[] args) throws Exception {
public static void main(String[] args) throws Exception {
Class.forName("org.h2.Driver");
String url = "jdbc:h2:~/test";
String url = "jdbc:h2:~/test";
Properties prop = new Properties();
Properties prop = new Properties();
prop.setProperty("user", "sa");
prop.setProperty("user", "sa");
...
@@ -1083,7 +1082,6 @@ public class Test {
...
@@ -1083,7 +1082,6 @@ public class Test {
}
}
</pre>
</pre>
<p>
<p>
This example requires Java 1.6.
When using Swing, use
<code>
javax.swing.JPasswordField
</code>
.
When using Swing, use
<code>
javax.swing.JPasswordField
</code>
.
</p>
</p>
...
...
h2/src/docsrc/html/cheatSheet.html
浏览文件 @
e979821e
...
@@ -169,7 +169,6 @@ Reference:
...
@@ -169,7 +169,6 @@ Reference:
<h2><a
href=
"tutorial.html#connecting_using_jdbc"
>
Using the JDBC API
</a></h2>
<h2><a
href=
"tutorial.html#connecting_using_jdbc"
>
Using the JDBC API
</a></h2>
<pre>
<pre>
Class.forName("org.h2.Driver");
Connection conn = DriverManager.
Connection conn = DriverManager.
getConnection("jdbc:h2:~/test");
getConnection("jdbc:h2:~/test");
conn.close();
conn.close();
...
...
h2/src/docsrc/html/faq.html
浏览文件 @
e979821e
...
@@ -117,7 +117,6 @@ and the database URL starts with <code>jdbc:h2:</code>.
...
@@ -117,7 +117,6 @@ and the database URL starts with <code>jdbc:h2:</code>.
To connect to a database using JDBC, use the following code:
To connect to a database using JDBC, use the following code:
</p>
</p>
<pre>
<pre>
Class.forName("org.h2.Driver");
Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
Connection conn = DriverManager.getConnection("jdbc:h2:~/test", "sa", "");
</pre>
</pre>
...
...
h2/src/docsrc/html/features.html
浏览文件 @
e979821e
...
@@ -669,7 +669,6 @@ and user passwords are case sensitive. Here is an example to connect to a
...
@@ -669,7 +669,6 @@ and user passwords are case sensitive. Here is an example to connect to a
password-encrypted database:
password-encrypted database:
</p>
</p>
<pre>
<pre>
Class.forName("org.h2.Driver");
String url = "jdbc:h2:~/test;CIPHER=AES";
String url = "jdbc:h2:~/test;CIPHER=AES";
String user = "sa";
String user = "sa";
String pwds = "filepwd userpwd";
String pwds = "filepwd userpwd";
...
...
h2/src/docsrc/html/tutorial.html
浏览文件 @
e979821e
...
@@ -456,7 +456,6 @@ import java.sql.*;
...
@@ -456,7 +456,6 @@ import java.sql.*;
public class Test {
public class Test {
public static void main(String[] a)
public static void main(String[] a)
throws Exception {
throws Exception {
Class.forName("org.h2.Driver");
Connection conn = DriverManager.
Connection conn = DriverManager.
getConnection("jdbc:h2:~/test", "sa", "");
getConnection("jdbc:h2:~/test", "sa", "");
// add application code here
// add application code here
...
@@ -465,8 +464,7 @@ public class Test {
...
@@ -465,8 +464,7 @@ public class Test {
}
}
</pre>
</pre>
<p>
<p>
This code first loads the driver (
<code>
Class.forName(...)
</code>
)
This code opens a connection (using
<code>
DriverManager.getConnection()
</code>
).
and then opens a connection (using
<code>
DriverManager.getConnection()
</code>
).
The driver name is
<code>
"org.h2.Driver"
</code>
.
The driver name is
<code>
"org.h2.Driver"
</code>
.
The database URL always needs to start with
<code>
jdbc:h2:
</code>
The database URL always needs to start with
<code>
jdbc:h2:
</code>
to be recognized by this database. The second parameter in the
<code>
getConnection()
</code>
call
to be recognized by this database. The second parameter in the
<code>
getConnection()
</code>
call
...
@@ -867,7 +865,6 @@ String url = "jdbc:h2:/data/data/" +
...
@@ -867,7 +865,6 @@ String url = "jdbc:h2:/data/data/" +
";FILE_LOCK=FS" +
";FILE_LOCK=FS" +
";PAGE_SIZE=1024" +
";PAGE_SIZE=1024" +
";CACHE_SIZE=8192";
";CACHE_SIZE=8192";
Class.forName("org.h2.Driver");
conn = DriverManager.getConnection(url);
conn = DriverManager.getConnection(url);
...
...
</pre>
</pre>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论