Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
2b4e2b4c
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dbeaver
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
2b4e2b4c
编写于
6月 30, 2018
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#3717 MySQL: server timezone selector
Former-commit-id:
b6681ea6
上级
d0d703d5
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
68 addition
and
14 deletion
+68
-14
plugins/org.jkiss.dbeaver.ext.mysql/OSGI-INF/l10n/bundle.properties
...g.jkiss.dbeaver.ext.mysql/OSGI-INF/l10n/bundle.properties
+1
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLConstants.java
...mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLConstants.java
+3
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLMessages.java
....mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLMessages.java
+3
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLResources.properties
...src/org/jkiss/dbeaver/ext/mysql/MySQLResources.properties
+3
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLUtils.java
...ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLUtils.java
+6
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
...rc/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
+5
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
...rg/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
+38
-10
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
...rg.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
+9
-3
未找到文件。
plugins/org.jkiss.dbeaver.ext.mysql/OSGI-INF/l10n/bundle.properties
浏览文件 @
2b4e2b4c
dialog.connection.header
=
MySQL
Connection Settings
dialog.connection.header
=
Connection Settings
tree.databases.node.name
=
Databases
tree.database.node.name
=
Database
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLConstants.java
浏览文件 @
2b4e2b4c
...
...
@@ -17,6 +17,7 @@
package
org.jkiss.dbeaver.ext.mysql
;
import
org.jkiss.dbeaver.model.DBConstants
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSIndexType
;
/**
...
...
@@ -33,6 +34,8 @@ public class MySQLConstants {
public
static
final
String
HANDLER_SSL
=
"mysql_ssl"
;
public
static
final
String
PROP_SERVER_TIMEZONE
=
DBConstants
.
INTERNAL_PROP_PREFIX
+
"serverTimezone@"
;
public
static
final
String
PROP_REQUIRE_SSL
=
"ssl.require"
;
public
static
final
String
PROP_VERIFY_SERVER_SERT
=
"ssl.verify.server"
;
public
static
final
String
PROP_SSL_CIPHER_SUITES
=
"ssl.cipher.suites"
;
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLMessages.java
浏览文件 @
2b4e2b4c
...
...
@@ -41,6 +41,9 @@ public class MySQLMessages extends NLS {
public
static
String
dialog_connection_port
;
public
static
String
dialog_connection_test_connection
;
public
static
String
dialog_connection_user_name
;
public
static
String
dialog_connection_server_timezone
;
public
static
String
dialog_connection_auto_detect
;
public
static
String
dialog_connection_local_client
;
public
static
String
edit_catalog_manager_dialog_schema_name
;
public
static
String
edit_command_change_user_action_create_new_user
;
public
static
String
edit_command_change_user_action_update_user_record
;
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLResources.properties
浏览文件 @
2b4e2b4c
...
...
@@ -9,6 +9,9 @@ dialog_connection_database=Database
dialog_connection_user_name
=
User name
dialog_connection_password
=
Password
dialog_connection_test_connection
=
Test Connection ...
dialog_connection_server_timezone
=
Server Time Zone
dialog_connection_auto_detect
=
Auto-detect
dialog_connection_local_client
=
Local Client
edit_catalog_manager_dialog_schema_name
=
Schema name
edit_command_change_user_action_create_new_user
=
Create new user
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/MySQLUtils.java
浏览文件 @
2b4e2b4c
...
...
@@ -19,6 +19,7 @@ package org.jkiss.dbeaver.ext.mysql;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.model.connection.DBPClientHome
;
import
org.jkiss.dbeaver.model.connection.DBPDriver
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet
;
...
...
@@ -144,4 +145,9 @@ public class MySQLUtils {
}
}
public
static
boolean
isMariaDB
(
DBPDriver
driver
)
{
return
MySQLConstants
.
DRIVER_CLASS_MARIA_DB
.
equals
(
driver
.
getDriverClassName
());
}
}
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
浏览文件 @
2b4e2b4c
...
...
@@ -101,6 +101,11 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
// Newer MySQL servers/connectors requires explicit SSL disable
props
.
put
(
"useSSL"
,
"false"
);
}
String
serverTZ
=
connectionInfo
.
getProviderProperty
(
MySQLConstants
.
PROP_SERVER_TIMEZONE
);
if
(!
CommonUtils
.
isEmpty
(
serverTZ
))
{
props
.
put
(
"serverTimezone"
,
serverTZ
);
}
/*
if (CommonUtils.toBoolean(connectionInfo.getProperty(MySQLConstants.PROP_USE_SSL))) {
url.append("?useSSL=true&requireSSL=true");
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/views/MySQLConnectionPage.java
浏览文件 @
2b4e2b4c
...
...
@@ -23,12 +23,14 @@ import org.eclipse.swt.events.ModifyEvent;
import
org.eclipse.swt.events.ModifyListener
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.Combo
;
import
org.eclipse.swt.widgets.Composite
;
import
org.eclipse.swt.widgets.Label
;
import
org.eclipse.swt.widgets.Text
;
import
org.jkiss.dbeaver.ext.mysql.Activator
;
import
org.jkiss.dbeaver.ext.mysql.MySQLConstants
;
import
org.jkiss.dbeaver.ext.mysql.MySQLMessages
;
import
org.jkiss.dbeaver.ext.mysql.MySQLUtils
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPDriver
;
...
...
@@ -39,7 +41,9 @@ import org.jkiss.dbeaver.ui.dialogs.connection.ConnectionPageAbstract;
import
org.jkiss.dbeaver.ui.dialogs.connection.DriverPropertiesDialogPage
;
import
org.jkiss.utils.CommonUtils
;
import
java.util.Arrays
;
import
java.util.Locale
;
import
java.util.TimeZone
;
/**
* MySQLConnectionPage
...
...
@@ -56,6 +60,7 @@ public class MySQLConnectionPage extends ConnectionPageAbstract implements IComp
private
static
ImageDescriptor
MYSQL_LOGO_IMG
=
Activator
.
getImageDescriptor
(
"icons/mysql_logo.png"
);
private
static
ImageDescriptor
MARIADB_LOGO_IMG
=
Activator
.
getImageDescriptor
(
"icons/mariadb_logo.png"
);
private
Combo
serverTimezoneCombo
;
@Override
...
...
@@ -129,19 +134,26 @@ public class MySQLConnectionPage extends ConnectionPageAbstract implements IComp
passwordText
.
setLayoutData
(
gd
);
passwordText
.
addModifyListener
(
textListener
);
{
Composite
clientPanel
=
UIUtils
.
createPlaceholder
(
addrGroup
,
1
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
);
gd
.
horizontalSpan
=
2
;
clientPanel
.
setLayoutData
(
gd
);
UIUtils
.
createHorizontalLine
(
clientPanel
);
UIUtils
.
createHorizontalLine
(
addrGroup
,
2
,
10
);
homesSelector
=
new
ClientHomesSelector
(
clientPanel
,
SWT
.
NONE
,
"Local Client"
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
|
GridData
.
HORIZONTAL_ALIGN_BEGINNING
);
homesSelector
.
getPanel
().
setLayoutData
(
gd
);
if
(!
MySQLUtils
.
isMariaDB
(
getSite
().
getDriver
()))
{
serverTimezoneCombo
=
UIUtils
.
createLabelCombo
(
addrGroup
,
MySQLMessages
.
dialog_connection_server_timezone
,
SWT
.
DROP_DOWN
);
serverTimezoneCombo
.
add
(
MySQLMessages
.
dialog_connection_auto_detect
);
{
String
[]
tzList
=
TimeZone
.
getAvailableIDs
();
for
(
String
tzID
:
tzList
)
{
//TimeZone timeZone = TimeZone.getTimeZone(tzID);
serverTimezoneCombo
.
add
(
tzID
);
}
}
serverTimezoneCombo
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_BEGINNING
));
}
homesSelector
=
new
ClientHomesSelector
(
addrGroup
,
SWT
.
NONE
,
MySQLMessages
.
dialog_connection_local_client
);
gd
=
new
GridData
(
GridData
.
FILL_HORIZONTAL
|
GridData
.
HORIZONTAL_ALIGN_BEGINNING
);
gd
.
horizontalSpan
=
2
;
homesSelector
.
getPanel
().
setLayoutData
(
gd
);
createDriverPanel
(
addrGroup
);
setControl
(
addrGroup
);
}
...
...
@@ -197,6 +209,15 @@ public class MySQLConnectionPage extends ConnectionPageAbstract implements IComp
if
(
passwordText
!=
null
)
{
passwordText
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getUserPassword
()));
}
if
(
serverTimezoneCombo
!=
null
)
{
String
tzProp
=
connectionInfo
.
getProviderProperty
(
MySQLConstants
.
PROP_SERVER_TIMEZONE
);
if
(
CommonUtils
.
isEmpty
(
tzProp
))
{
serverTimezoneCombo
.
select
(
0
);
}
else
{
serverTimezoneCombo
.
setText
(
tzProp
);
}
}
homesSelector
.
populateHomes
(
site
.
getDriver
(),
connectionInfo
.
getClientHomeId
());
activated
=
true
;
...
...
@@ -221,6 +242,13 @@ public class MySQLConnectionPage extends ConnectionPageAbstract implements IComp
if
(
passwordText
!=
null
)
{
connectionInfo
.
setUserPassword
(
passwordText
.
getText
());
}
if
(
serverTimezoneCombo
!=
null
)
{
if
(
serverTimezoneCombo
.
getSelectionIndex
()
==
0
||
CommonUtils
.
isEmpty
(
serverTimezoneCombo
.
getText
()))
{
connectionInfo
.
removeProviderProperty
(
MySQLConstants
.
PROP_SERVER_TIMEZONE
);
}
else
{
connectionInfo
.
setProviderProperty
(
MySQLConstants
.
PROP_SERVER_TIMEZONE
,
serverTimezoneCombo
.
getText
());
}
}
if
(
homesSelector
!=
null
)
{
connectionInfo
.
setClientHomeId
(
homesSelector
.
getSelectedHome
());
}
...
...
plugins/org.jkiss.dbeaver.ui/src/org/jkiss/dbeaver/ui/UIUtils.java
浏览文件 @
2b4e2b4c
...
...
@@ -761,10 +761,16 @@ public class UIUtils {
gd
.
verticalSpan
=
verticalSpan
;
}
public
static
Label
createHorizontalLine
(
Composite
parent
)
{
public
static
Label
createHorizontalLine
(
Composite
parent
)
{
return
createHorizontalLine
(
parent
,
1
,
0
);
}
public
static
Label
createHorizontalLine
(
Composite
parent
,
int
hSpan
,
int
vIndent
)
{
Label
horizontalLine
=
new
Label
(
parent
,
SWT
.
SEPARATOR
|
SWT
.
HORIZONTAL
);
horizontalLine
.
setLayoutData
(
new
GridData
(
GridData
.
FILL
,
GridData
.
FILL
,
true
,
false
,
1
,
1
));
GridData
gd
=
new
GridData
(
GridData
.
FILL
,
GridData
.
FILL
,
true
,
false
,
1
,
1
);
gd
.
horizontalSpan
=
hSpan
;
gd
.
verticalIndent
=
vIndent
;
horizontalLine
.
setLayoutData
(
gd
);
return
horizontalLine
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录