Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
H
h2database
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
Administrator
h2database
Commits
725532f8
提交
725532f8
authored
7月 02, 2010
作者:
Thomas Mueller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ODBC: additional connection settings can now be added to the database name.
上级
91e00175
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
23 行增加
和
15 行删除
+23
-15
advanced.html
h2/src/docsrc/html/advanced.html
+8
-7
changelog.html
h2/src/docsrc/html/changelog.html
+3
-1
roadmap.html
h2/src/docsrc/html/roadmap.html
+1
-0
ConnectionInfo.java
h2/src/main/org/h2/engine/ConnectionInfo.java
+1
-1
PgServerThread.java
h2/src/main/org/h2/server/pg/PgServerThread.java
+10
-6
没有找到文件。
h2/src/docsrc/html/advanced.html
浏览文件 @
725532f8
...
@@ -524,22 +524,23 @@ By default, only connections from localhost are allowed. To allow remote connect
...
@@ -524,22 +524,23 @@ By default, only connections from localhost are allowed. To allow remote connect
After installing the driver, a new Data Source must be added. In Windows,
After installing the driver, a new Data Source must be added. In Windows,
run
<code>
odbcad32.exe
</code>
to open the Data Source Administrator. Then click on 'Add...'
run
<code>
odbcad32.exe
</code>
to open the Data Source Administrator. Then click on 'Add...'
and select the PostgreSQL Unicode driver. Then click 'Finish'.
and select the PostgreSQL Unicode driver. Then click 'Finish'.
You will be able to change the connection properties:
You will be able to change the connection properties.
The property column represents the property key in the
<code>
odbc.ini
</code>
file
(which may be different from the GUI).
</p>
</p>
<table>
<table>
<tr><th>
Property
</th><th>
Example
</th><th>
Remarks
</th></tr>
<tr><th>
Property
</th><th>
Example
</th><th>
Remarks
</th></tr>
<tr><td>
Data Source
</td><td>
H2 Test
</td><td>
The name of the ODBC Data Source
</td></tr>
<tr><td>
Data Source
</td><td>
H2 Test
</td><td>
The name of the ODBC Data Source
</td></tr>
<tr><td>
Database
</td><td>
test
</td>
<tr><td>
Database
</td><td>
~/test;ifexists=true
</td>
<td>
<td>
The database name. Only simple names are supported at this time;
<br
/>
The database name. This can include connections settings.
<br
/>
relative or absolute path are not supported in the database name.
<br
/>
By default, the database is stored in the current working directory
<br
/>
By default, the database is stored in the current working directory
<br
/>
where the Server is started except when the -baseDir setting is used.
<br
/>
where the Server is started except when the -baseDir setting is used.
<br
/>
The name must be at least 3 characters.
The name must be at least 3 characters.
</td></tr>
</td></tr>
<tr><td>
Server
</td><td>
localhost
</td><td>
The server name or IP address.
<br
/>
By default, only remote connections are allowed
</td></tr>
<tr><td>
Server
name
</td><td>
localhost
</td><td>
The server name or IP address.
<br
/>
By default, only remote connections are allowed
</td></tr>
<tr><td>
User
N
ame
</td><td>
sa
</td><td>
The database user name.
</td></tr>
<tr><td>
User
n
ame
</td><td>
sa
</td><td>
The database user name.
</td></tr>
<tr><td>
SSL
Mode
</td><td>
disabled
</td><td>
At this time, SSL is not supported.
</td></tr>
<tr><td>
SSL
</td><td>
false (disabled)
</td><td>
At this time, SSL is not supported.
</td></tr>
<tr><td>
Port
</td><td>
5435
</td><td>
The port where the PG Server is listening.
</td></tr>
<tr><td>
Port
</td><td>
5435
</td><td>
The port where the PG Server is listening.
</td></tr>
<tr><td>
Password
</td><td>
sa
</td><td>
The database password.
</td></tr>
<tr><td>
Password
</td><td>
sa
</td><td>
The database password.
</td></tr>
</table>
</table>
...
...
h2/src/docsrc/html/changelog.html
浏览文件 @
725532f8
...
@@ -18,7 +18,9 @@ Change Log
...
@@ -18,7 +18,9 @@ Change Log
<h1>
Change Log
</h1>
<h1>
Change Log
</h1>
<h2>
Next Version (unreleased)
</h2>
<h2>
Next Version (unreleased)
</h2>
<ul><li>
Local temporary tables can now be created without having to commit a transaction
<ul><li>
ODBC: additional connection settings can now be added to the database name.
Example: ~/test;cipher=xtea. Therefore, encrypted databases are supported.
</li><li>
Local temporary tables can now be created without having to commit a transaction
using CREATE LOCAL TEMPORARY TABLE TEMP(ID INT PRIMARY KEY) TRANSACTIONAL.
using CREATE LOCAL TEMPORARY TABLE TEMP(ID INT PRIMARY KEY) TRANSACTIONAL.
</li><li>
New system property h2.dropRestrict (default false) to change the
</li><li>
New system property h2.dropRestrict (default false) to change the
default action for DROP TABLE and DROP VIEW (false for CASCADE, true for RESTRICT).
default action for DROP TABLE and DROP VIEW (false for CASCADE, true for RESTRICT).
...
...
h2/src/docsrc/html/roadmap.html
浏览文件 @
725532f8
...
@@ -514,6 +514,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
...
@@ -514,6 +514,7 @@ See also <a href="build.html#providing_patches">Providing Patches</a>.
</li><li>
User defined aggregate: allow declaring as source code (like functions).
</li><li>
User defined aggregate: allow declaring as source code (like functions).
</li><li>
The error "table not found" is sometimes caused by using the wrong database.
</li><li>
The error "table not found" is sometimes caused by using the wrong database.
Add "(this database is empty)" to the exception message if applicable.
Add "(this database is empty)" to the exception message if applicable.
</li><li>
PostgreSQL compatibility: support escape with double \\.
</li></ul>
</li></ul>
<h2>
Not Planned
</h2>
<h2>
Not Planned
</h2>
...
...
h2/src/main/org/h2/engine/ConnectionInfo.java
浏览文件 @
725532f8
...
@@ -243,7 +243,7 @@ public class ConnectionInfo implements Cloneable {
...
@@ -243,7 +243,7 @@ public class ConnectionInfo implements Cloneable {
* Split the password property into file password and user password if
* Split the password property into file password and user password if
* necessary, and convert them to the internal hash format.
* necessary, and convert them to the internal hash format.
*/
*/
p
ublic
void
convertPasswords
()
{
p
rivate
void
convertPasswords
()
{
char
[]
password
=
removePassword
();
char
[]
password
=
removePassword
();
SHA256
sha
=
new
SHA256
();
SHA256
sha
=
new
SHA256
();
if
(
getProperty
(
"CIPHER"
,
null
)
!=
null
)
{
if
(
getProperty
(
"CIPHER"
,
null
)
!=
null
)
{
...
...
h2/src/main/org/h2/server/pg/PgServerThread.java
浏览文件 @
725532f8
...
@@ -27,6 +27,7 @@ import java.sql.SQLException;
...
@@ -27,6 +27,7 @@ import java.sql.SQLException;
import
java.sql.Statement
;
import
java.sql.Statement
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.HashSet
;
import
java.util.HashSet
;
import
java.util.Properties
;
import
org.h2.constant.SysProperties
;
import
org.h2.constant.SysProperties
;
import
org.h2.engine.ConnectionInfo
;
import
org.h2.engine.ConnectionInfo
;
import
org.h2.jdbc.JdbcConnection
;
import
org.h2.jdbc.JdbcConnection
;
...
@@ -155,10 +156,13 @@ public class PgServerThread implements Runnable {
...
@@ -155,10 +156,13 @@ public class PgServerThread implements Runnable {
}
else
if
(
"database"
.
equals
(
param
))
{
}
else
if
(
"database"
.
equals
(
param
))
{
this
.
databaseName
=
value
;
this
.
databaseName
=
value
;
}
else
if
(
"client_encoding"
.
equals
(
param
))
{
}
else
if
(
"client_encoding"
.
equals
(
param
))
{
// UTF8
clientEncoding
=
value
;
clientEncoding
=
value
;
}
else
if
(
"DateStyle"
.
equals
(
param
))
{
}
else
if
(
"DateStyle"
.
equals
(
param
))
{
dateStyle
=
value
;
dateStyle
=
value
;
}
}
// extra_float_digits 2
// geqo on (Genetic Query Optimization)
server
.
trace
(
" param "
+
param
+
"="
+
value
);
server
.
trace
(
" param "
+
param
+
"="
+
value
);
}
}
sendAuthenticationCleartextPassword
();
sendAuthenticationCleartextPassword
();
...
@@ -169,7 +173,12 @@ public class PgServerThread implements Runnable {
...
@@ -169,7 +173,12 @@ public class PgServerThread implements Runnable {
server
.
trace
(
"PasswordMessage"
);
server
.
trace
(
"PasswordMessage"
);
String
password
=
readString
();
String
password
=
readString
();
try
{
try
{
ConnectionInfo
ci
=
new
ConnectionInfo
(
databaseName
);
Properties
info
=
new
Properties
();
info
.
put
(
"MODE"
,
"PostgreSQL"
);
info
.
put
(
"USER"
,
userName
);
info
.
put
(
"PASSWORD"
,
password
);
String
url
=
"jdbc:h2:"
+
databaseName
;
ConnectionInfo
ci
=
new
ConnectionInfo
(
url
,
info
);
String
baseDir
=
server
.
getBaseDir
();
String
baseDir
=
server
.
getBaseDir
();
if
(
baseDir
==
null
)
{
if
(
baseDir
==
null
)
{
baseDir
=
SysProperties
.
getBaseDir
();
baseDir
=
SysProperties
.
getBaseDir
();
...
@@ -180,11 +189,6 @@ public class PgServerThread implements Runnable {
...
@@ -180,11 +189,6 @@ public class PgServerThread implements Runnable {
if
(
server
.
getIfExists
())
{
if
(
server
.
getIfExists
())
{
ci
.
setProperty
(
"IFEXISTS"
,
"TRUE"
);
ci
.
setProperty
(
"IFEXISTS"
,
"TRUE"
);
}
}
ci
.
setProperty
(
"MODE"
,
"PostgreSQL"
);
ci
.
setOriginalURL
(
"jdbc:h2:"
+
databaseName
+
";MODE=PostgreSQL"
);
ci
.
setUserName
(
userName
);
ci
.
setProperty
(
"PASSWORD"
,
password
);
ci
.
convertPasswords
();
conn
=
new
JdbcConnection
(
ci
,
false
);
conn
=
new
JdbcConnection
(
ci
,
false
);
// can not do this because when called inside
// can not do this because when called inside
// DriverManager.getConnection, a deadlock occurs
// DriverManager.getConnection, a deadlock occurs
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论