Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
4180b187
D
dbeaver
项目概览
suliangchun
/
dbeaver
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
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,发现更多精彩内容 >>
提交
4180b187
编写于
12月 26, 2017
作者:
S
serge-rider
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/devel' into devel
Former-commit-id:
ced802c9
上级
c3d9bcb2
5315ffdf
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
75 addition
and
9 deletion
+75
-9
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/RegistryConstants.java
...ore/src/org/jkiss/dbeaver/registry/RegistryConstants.java
+1
-0
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerConstants.java
...l/src/org/jkiss/dbeaver/ext/mssql/SQLServerConstants.java
+4
-0
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerDataSourceProvider.java
.../jkiss/dbeaver/ext/mssql/SQLServerDataSourceProvider.java
+3
-0
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerMessages.java
...ql/src/org/jkiss/dbeaver/ext/mssql/SQLServerMessages.java
+1
-1
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerResources.properties
...org/jkiss/dbeaver/ext/mssql/SQLServerResources.properties
+1
-1
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerDataSource.java
...rg/jkiss/dbeaver/ext/mssql/model/SQLServerDataSource.java
+21
-0
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/ui/SQLServerConnectionPage.java
...g/jkiss/dbeaver/ext/mssql/ui/SQLServerConnectionPage.java
+44
-7
未找到文件。
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/registry/RegistryConstants.java
浏览文件 @
4180b187
...
...
@@ -166,6 +166,7 @@ public class RegistryConstants {
public
static
final
String
ATTR_DATABASE
=
"database"
;
//$NON-NLS-1$
public
static
final
String
ATTR_USER
=
"user"
;
//$NON-NLS-1$
public
static
final
String
ATTR_PASSWORD
=
"password"
;
//$NON-NLS-1$
public
static
final
String
ATTR_NATIVE_AUTH
=
"native-auth"
;
//$NON-NLS-1$
public
static
final
String
ATTR_HOME
=
"home"
;
//$NON-NLS-1$
public
static
final
String
ATTR_SHOW_PANEL
=
"show-panel"
;
//$NON-NLS-1$
public
static
final
String
ATTR_WAIT_PROCESS
=
"wait-process"
;
//$NON-NLS-1$
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerConstants.java
浏览文件 @
4180b187
...
...
@@ -17,6 +17,8 @@
*/
package
org.jkiss.dbeaver.ext.mssql
;
import
org.jkiss.dbeaver.model.DBConstants
;
public
class
SQLServerConstants
{
public
static
final
int
DEFAULT_PORT
=
1433
;
...
...
@@ -25,4 +27,6 @@ public class SQLServerConstants {
public
static
final
String
DRIVER_JTDS
=
"mssql_jdbc_jtds"
;
public
static
final
String
DRIVER_MS
=
"mssql_jdbc_ms"
;
public
static
final
String
PROP_CONNECTION_WINDOWS_AUTH
=
DBConstants
.
INTERNAL_PROP_PREFIX
+
"connection-windows-auth@"
;
}
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerDataSourceProvider.java
浏览文件 @
4180b187
...
...
@@ -81,6 +81,9 @@ public class SQLServerDataSourceProvider extends JDBCDataSourceProvider implemen
url
.
append
(
"databaseName="
).
append
(
connectionInfo
.
getDatabaseName
());
}
}
if
(
"TRUE"
.
equalsIgnoreCase
(
connectionInfo
.
getProviderProperty
(
SQLServerConstants
.
PROP_CONNECTION_WINDOWS_AUTH
)))
{
url
.
append
(
";integratedSecurity=true"
);
}
return
url
.
toString
();
}
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerMessages.java
浏览文件 @
4180b187
...
...
@@ -32,7 +32,7 @@ public class SQLServerMessages extends NLS {
public
static
String
dialog_connection_advanced_tab
;
public
static
String
dialog_connection_advanced_tab_tooltip
;
public
static
String
dialog_connection_
browse
_button
;
public
static
String
dialog_connection_
windows_authentication
_button
;
public
static
String
dialog_connection_database_schema_label
;
public
static
String
dialog_connection_general_tab
;
public
static
String
dialog_connection_general_tab_tooltip
;
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/SQLServerResources.properties
浏览文件 @
4180b187
...
...
@@ -10,7 +10,7 @@ dialog_setting_connection_user = User
dialog_connection_advanced_tab
=
Advanced
dialog_connection_advanced_tab_tooltip
=
Advanced/custom driver properties
dialog_connection_
browse_button
=
Browse ...
dialog_connection_
windows_authentication_button
=
Windows Authentication
dialog_connection_database_schema_label
=
Database/Schema:
dialog_connection_general_tab
=
General
dialog_connection_general_tab_tooltip
=
General connection properties
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerDataSource.java
浏览文件 @
4180b187
...
...
@@ -19,10 +19,14 @@ package org.jkiss.dbeaver.ext.mssql.model;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.ext.generic.model.GenericDataSource
;
import
org.jkiss.dbeaver.ext.generic.model.meta.GenericMetaModel
;
import
org.jkiss.dbeaver.ext.mssql.SQLServerConstants
;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
import
java.sql.Connection
;
import
java.util.Locale
;
public
class
SQLServerDataSource
extends
GenericDataSource
{
...
...
@@ -33,4 +37,21 @@ public class SQLServerDataSource extends GenericDataSource {
super
(
monitor
,
container
,
metaModel
,
new
SQLServerDialect
());
}
@Override
protected
String
getConnectionUserName
(
DBPConnectionConfiguration
connectionInfo
)
{
if
(
"TRUE"
.
equalsIgnoreCase
(
connectionInfo
.
getProviderProperty
(
SQLServerConstants
.
PROP_CONNECTION_WINDOWS_AUTH
)))
{
return
""
;
}
else
{
return
super
.
getConnectionUserName
(
connectionInfo
);
}
}
@Override
protected
String
getConnectionUserPassword
(
DBPConnectionConfiguration
connectionInfo
)
{
if
(
"TRUE"
.
equalsIgnoreCase
(
connectionInfo
.
getProviderProperty
(
SQLServerConstants
.
PROP_CONNECTION_WINDOWS_AUTH
)))
{
return
""
;
}
else
{
return
super
.
getConnectionUserPassword
(
connectionInfo
);
}
}
}
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/ui/SQLServerConnectionPage.java
浏览文件 @
4180b187
...
...
@@ -20,6 +20,8 @@ package org.jkiss.dbeaver.ext.mssql.ui;
import
org.eclipse.jface.dialogs.IDialogPage
;
import
org.eclipse.jface.resource.ImageDescriptor
;
import
org.eclipse.swt.SWT
;
import
org.eclipse.swt.events.SelectionAdapter
;
import
org.eclipse.swt.events.SelectionEvent
;
import
org.eclipse.swt.layout.GridData
;
import
org.eclipse.swt.layout.GridLayout
;
import
org.eclipse.swt.widgets.*
;
...
...
@@ -29,6 +31,7 @@ import org.jkiss.dbeaver.ext.mssql.SQLServerMessages;
import
org.jkiss.dbeaver.model.DBPDataSourceContainer
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.ui.ICompositeDialogPage
;
import
org.jkiss.dbeaver.ui.UIUtils
;
import
org.jkiss.dbeaver.ui.dialogs.connection.ConnectionPageAbstract
;
import
org.jkiss.dbeaver.ui.dialogs.connection.DriverPropertiesDialogPage
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -43,21 +46,20 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
private
Text
hostText
;
private
Text
portText
;
private
Text
dbText
;
private
Label
userNameLabel
;
private
Text
userNameText
;
private
Label
passwordLabel
;
private
Text
passwordText
;
private
Button
windowsAuthetticationButton
;
private
Composite
settingsGroup
;
private
Map
<
String
,
List
<
Control
>>
propGroupMap
=
new
HashMap
<>();
private
static
final
String
GROUP_URL
=
"url"
;
//$NON-NLS-1$
private
static
final
String
GROUP_HOST
=
"host"
;
//$NON-NLS-1$
private
static
final
String
GROUP_SERVER
=
"server"
;
//$NON-NLS-1$
private
static
final
String
GROUP_DB
=
"db"
;
//$NON-NLS-1$
private
static
final
String
GROUP_PATH
=
"path"
;
//$NON-NLS-1$
private
static
final
String
GROUP_LOGIN
=
"login"
;
//$NON-NLS-1$
private
boolean
activated
;
private
Button
createButton
;
private
static
ImageDescriptor
LOGO_IMG
=
SQLServerActivator
.
getImageDescriptor
(
"icons/mssql_logo.png"
);
...
...
@@ -124,7 +126,16 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
}
{
Label
userNameLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
windowsAuthetticationButton
=
UIUtils
.
createLabelCheckbox
(
settingsGroup
,
SQLServerMessages
.
dialog_connection_windows_authentication_button
,
false
);
addControlToGroup
(
GROUP_DB
,
windowsAuthetticationButton
);
Control
emptyLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
gd
=
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
);
gd
.
horizontalSpan
=
2
;
gd
.
widthHint
=
0
;
emptyLabel
.
setLayoutData
(
gd
);
userNameLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
userNameLabel
.
setText
(
SQLServerMessages
.
dialog_connection_user_name_label
);
userNameLabel
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
));
...
...
@@ -133,9 +144,9 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
gd
.
grabExcessHorizontalSpace
=
true
;
userNameText
.
setLayoutData
(
gd
);
Control
emptyLabel
=
createEmptyLabel
(
settingsGroup
,
2
);
emptyLabel
=
createEmptyLabel
(
settingsGroup
,
2
);
Label
passwordLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
passwordLabel
=
new
Label
(
settingsGroup
,
SWT
.
NONE
);
passwordLabel
.
setText
(
SQLServerMessages
.
dialog_connection_password_label
);
passwordLabel
.
setLayoutData
(
new
GridData
(
GridData
.
HORIZONTAL_ALIGN_END
));
...
...
@@ -144,6 +155,13 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
gd
.
grabExcessHorizontalSpace
=
true
;
passwordText
.
setLayoutData
(
gd
);
windowsAuthetticationButton
.
addSelectionListener
(
new
SelectionAdapter
()
{
@Override
public
void
widgetSelected
(
SelectionEvent
e
)
{
enableTexts
();
}
});
addControlToGroup
(
GROUP_LOGIN
,
userNameLabel
);
addControlToGroup
(
GROUP_LOGIN
,
userNameText
);
addControlToGroup
(
GROUP_LOGIN
,
emptyLabel
);
...
...
@@ -155,6 +173,14 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
setControl
(
settingsGroup
);
}
private
void
enableTexts
()
{
boolean
selection
=
windowsAuthetticationButton
.
getSelection
();
userNameLabel
.
setEnabled
(!
selection
);
userNameText
.
setEnabled
(!
selection
);
passwordLabel
.
setEnabled
(!
selection
);
passwordText
.
setEnabled
(!
selection
);
}
private
void
addControlToGroup
(
String
group
,
Control
control
)
{
List
<
Control
>
controlList
=
propGroupMap
.
get
(
group
);
...
...
@@ -224,6 +250,13 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
if
(
passwordText
!=
null
)
{
passwordText
.
setText
(
CommonUtils
.
notEmpty
(
connectionInfo
.
getUserPassword
()));
}
if
(
windowsAuthetticationButton
!=
null
)
{
String
winAuthProperty
=
connectionInfo
.
getProviderProperty
(
SQLServerConstants
.
PROP_CONNECTION_WINDOWS_AUTH
);
if
(
winAuthProperty
!=
null
)
{
windowsAuthetticationButton
.
setSelection
(
Boolean
.
parseBoolean
(
winAuthProperty
));
}
enableTexts
();
}
activated
=
true
;
}
...
...
@@ -247,6 +280,10 @@ public class SQLServerConnectionPage extends ConnectionPageAbstract implements I
if
(
passwordText
!=
null
)
{
connectionInfo
.
setUserPassword
(
passwordText
.
getText
());
}
if
(
windowsAuthetticationButton
!=
null
)
{
connectionInfo
.
setProviderProperty
(
SQLServerConstants
.
PROP_CONNECTION_WINDOWS_AUTH
,
String
.
valueOf
(
windowsAuthetticationButton
.
getSelection
()));
}
super
.
saveSettings
(
dataSource
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录