Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
0e67f09b
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,发现更多精彩内容 >>
提交
0e67f09b
编写于
12月 14, 2019
作者:
S
Serge Rider
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
#5172 MySQL model. Model refactoring
上级
4ddac586
变更
13
隐藏空白更改
内联
并排
Showing
13 changed file
with
177 addition
and
88 deletion
+177
-88
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2DataSource.java
...b2/src/org/jkiss/dbeaver/ext/db2/model/DB2DataSource.java
+1
-1
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/model/ExasolDataSource.java
.../org/jkiss/dbeaver/ext/exasol/model/ExasolDataSource.java
+1
-1
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/model/GenericDataSource.java
...rg/jkiss/dbeaver/ext/generic/model/GenericDataSource.java
+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
+2
-6
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLTriggerManager.java
...org/jkiss/dbeaver/ext/mysql/edit/MySQLTriggerManager.java
+1
-1
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
...rc/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
+24
-68
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLExecutionContext.java
.../jkiss/dbeaver/ext/mysql/model/MySQLExecutionContext.java
+139
-0
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLStructureAssistant.java
...kiss/dbeaver/ext/mysql/model/MySQLStructureAssistant.java
+1
-1
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleDataSource.java
.../org/jkiss/dbeaver/ext/oracle/model/OracleDataSource.java
+1
-1
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
...jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
+2
-6
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+1
-1
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
...g/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
+2
-0
plugins/org.jkiss.dbeaver.ui.editors.base/src/org/jkiss/dbeaver/ui/editors/EditorUtils.java
...rs.base/src/org/jkiss/dbeaver/ui/editors/EditorUtils.java
+1
-1
未找到文件。
plugins/org.jkiss.dbeaver.ext.db2/src/org/jkiss/dbeaver/ext/db2/model/DB2DataSource.java
浏览文件 @
0e67f09b
...
...
@@ -193,7 +193,7 @@ public class DB2DataSource extends JDBCDataSource implements DBSObjectSelector,
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
boolean
setActiveObject
)
throws
DBException
{
if
(
setActiveObject
)
{
setCurrentSchema
(
monitor
,
context
,
getDefaultObject
());
...
...
plugins/org.jkiss.dbeaver.ext.exasol/src/org/jkiss/dbeaver/ext/exasol/model/ExasolDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -366,7 +366,7 @@ public class ExasolDataSource extends JDBCDataSource
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBC
Exception
throws
DB
Exception
{
if
(
setActiveObject
)
{
setCurrentSchema
(
monitor
,
context
,
getDefaultObject
());
...
...
plugins/org.jkiss.dbeaver.ext.generic/src/org/jkiss/dbeaver/ext/generic/model/GenericDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -181,7 +181,7 @@ public class GenericDataSource extends JDBCDataSource implements DBPTermProvider
return
new
GenericExecutionContext
(
instance
,
type
);
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
{
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
super
.
initializeContextState
(
monitor
,
context
,
setActiveObject
);
boolean
hasActiveObject
=
false
;
if
(
setActiveObject
)
{
...
...
plugins/org.jkiss.dbeaver.ext.mssql/src/org/jkiss/dbeaver/ext/mssql/model/SQLServerDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -132,7 +132,7 @@ public class SQLServerDataSource extends JDBCDataSource implements DBSInstanceCo
}
@Override
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
{
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
super
.
initializeContextState
(
monitor
,
context
,
setActiveObject
);
if
(
setActiveObject
)
{
SQLServerDatabase
defaultObject
=
getDefaultDatabase
(
monitor
);
...
...
@@ -140,11 +140,7 @@ public class SQLServerDataSource extends JDBCDataSource implements DBSInstanceCo
((
SQLServerExecutionContext
)
context
).
setCurrentDatabase
(
monitor
,
defaultObject
);
}
}
else
{
try
{
((
SQLServerExecutionContext
)
context
).
refreshDefaults
(
monitor
);
}
catch
(
DBException
e
)
{
throw
new
DBCException
(
"Error reading connection defaults"
);
}
((
SQLServerExecutionContext
)
context
).
refreshDefaults
(
monitor
);
}
}
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/edit/MySQLTriggerManager.java
浏览文件 @
0e67f09b
...
...
@@ -61,7 +61,7 @@ public class MySQLTriggerManager extends SQLTriggerManager<MySQLTrigger, MySQLTa
"DROP TRIGGER IF EXISTS "
+
trigger
.
getFullyQualifiedName
(
DBPEvaluationContext
.
DDL
))
);
}
MySQLCatalog
curCatalog
=
trigger
.
getCatalog
().
getDataSource
().
getDefault
Object
();
MySQLCatalog
curCatalog
=
trigger
.
getCatalog
().
getDataSource
().
getDefault
Database
();
if
(
curCatalog
!=
trigger
.
getCatalog
())
{
actions
.
add
(
new
SQLDatabasePersistAction
(
"Set current schema "
,
"USE "
+
DBUtils
.
getQuotedIdentifier
(
trigger
.
getCatalog
()),
false
));
//$NON-NLS-2$
}
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -31,15 +31,15 @@ import org.jkiss.dbeaver.model.admin.sessions.DBAServerSessionManager;
import
org.jkiss.dbeaver.model.app.DBACertificateStorage
;
import
org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration
;
import
org.jkiss.dbeaver.model.connection.DBPDriver
;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContext
;
import
org.jkiss.dbeaver.model.exec.DBCQueryTransformType
;
import
org.jkiss.dbeaver.model.exec.DBCQueryTransformer
;
import
org.jkiss.dbeaver.model.exec.jdbc.*
;
import
org.jkiss.dbeaver.model.exec.plan.DBCQueryPlanner
;
import
org.jkiss.dbeaver.model.gis.GisConstants
;
import
org.jkiss.dbeaver.model.gis.SpatialDataProvider
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCConstants
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.impl.jdbc.*
;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCBasicDataTypeCache
;
import
org.jkiss.dbeaver.model.impl.jdbc.cache.JDBCObjectCache
;
import
org.jkiss.dbeaver.model.impl.jdbc.struct.JDBCDataType
;
...
...
@@ -48,7 +48,10 @@ import org.jkiss.dbeaver.model.net.DBWHandlerConfiguration;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.sql.SQLHelpProvider
;
import
org.jkiss.dbeaver.model.sql.SQLState
;
import
org.jkiss.dbeaver.model.struct.*
;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObjectFilter
;
import
org.jkiss.dbeaver.model.struct.DBSStructureAssistant
;
import
org.jkiss.utils.CommonUtils
;
import
org.jkiss.utils.IOUtils
;
...
...
@@ -64,7 +67,7 @@ import java.util.regex.Pattern;
/**
* GenericDataSource
*/
public
class
MySQLDataSource
extends
JDBCDataSource
implements
DBSObjectSelector
{
public
class
MySQLDataSource
extends
JDBCDataSource
{
private
static
final
Log
log
=
Log
.
getLog
(
MySQLDataSource
.
class
);
private
final
JDBCBasicDataTypeCache
<
MySQLDataSource
,
JDBCDataType
>
dataTypeCache
;
...
...
@@ -193,15 +196,26 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBCException
{
@Override
protected
JDBCExecutionContext
createExecutionContext
(
JDBCRemoteInstance
instance
,
String
type
)
{
return
new
MySQLExecutionContext
(
instance
,
type
);
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
if
(
setActiveObject
)
{
MySQLCatalog
object
=
getDefault
Object
();
MySQLCatalog
object
=
getDefault
Database
();
if
(
object
!=
null
)
{
useDatabase
(
monitor
,
context
,
object
);
((
MySQLExecutionContext
)
context
).
setCurrentDatabase
(
monitor
,
object
);
}
}
else
{
((
MySQLExecutionContext
)
context
).
refreshDefaults
(
monitor
);
}
}
public
MySQLCatalog
getDefaultDatabase
()
{
return
(
MySQLCatalog
)
DBUtils
.
getDefaultContext
(
this
,
true
).
getContextDefaults
().
getDefaultCatalog
();
}
public
String
[]
getTableTypes
()
{
return
MySQLConstants
.
TABLE_TYPES
;
}
...
...
@@ -348,64 +362,6 @@ public class MySQLDataSource extends JDBCDataSource implements DBSObjectSelector
}
@Override
public
boolean
supportsDefaultChange
()
{
return
true
;
}
@Override
public
MySQLCatalog
getDefaultObject
()
{
return
CommonUtils
.
isEmpty
(
activeCatalogName
)
?
null
:
getCatalog
(
activeCatalogName
);
}
@Override
public
void
setDefaultObject
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
DBSObject
object
)
throws
DBException
{
final
MySQLCatalog
oldSelectedEntity
=
getDefaultObject
();
if
(!(
object
instanceof
MySQLCatalog
))
{
throw
new
DBException
(
"Invalid object type: "
+
object
);
}
for
(
JDBCExecutionContext
context
:
getDefaultInstance
().
getAllContexts
())
{
useDatabase
(
monitor
,
context
,
(
MySQLCatalog
)
object
);
}
activeCatalogName
=
object
.
getName
();
// Send notifications
if
(
oldSelectedEntity
!=
null
)
{
DBUtils
.
fireObjectSelect
(
oldSelectedEntity
,
false
);
}
if
(
this
.
activeCatalogName
!=
null
)
{
DBUtils
.
fireObjectSelect
(
object
,
true
);
}
}
@Override
public
boolean
refreshDefaultObject
(
@NotNull
DBCSession
session
)
throws
DBException
{
final
String
newCatalogName
=
MySQLUtils
.
determineCurrentDatabase
((
JDBCSession
)
session
);
if
(!
CommonUtils
.
equalObjects
(
newCatalogName
,
activeCatalogName
))
{
final
MySQLCatalog
newCatalog
=
getCatalog
(
newCatalogName
);
if
(
newCatalog
!=
null
)
{
setDefaultObject
(
session
.
getProgressMonitor
(),
newCatalog
);
return
true
;
}
}
return
false
;
}
private
void
useDatabase
(
DBRProgressMonitor
monitor
,
JDBCExecutionContext
context
,
MySQLCatalog
catalog
)
throws
DBCException
{
if
(
catalog
==
null
)
{
log
.
debug
(
"Null current database"
);
return
;
}
try
(
JDBCSession
session
=
context
.
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Set active catalog"
))
{
try
(
JDBCPreparedStatement
dbStat
=
session
.
prepareStatement
(
"use "
+
DBUtils
.
getQuotedIdentifier
(
catalog
)))
{
dbStat
.
execute
();
}
}
catch
(
SQLException
e
)
{
throw
new
DBCException
(
e
,
this
);
}
}
@Override
protected
Connection
openConnection
(
@NotNull
DBRProgressMonitor
monitor
,
@Nullable
JDBCExecutionContext
context
,
@NotNull
String
purpose
)
throws
DBCException
{
Connection
mysqlConnection
=
super
.
openConnection
(
monitor
,
context
,
purpose
);
...
...
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLExecutionContext.java
0 → 100644
浏览文件 @
0e67f09b
/*
* DBeaver - Universal Database Manager
* Copyright (C) 2010-2019 Serge Rider (serge@jkiss.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package
org.jkiss.dbeaver.ext.mysql.model
;
import
org.jkiss.code.NotNull
;
import
org.jkiss.code.Nullable
;
import
org.jkiss.dbeaver.DBException
;
import
org.jkiss.dbeaver.Log
;
import
org.jkiss.dbeaver.ext.mysql.MySQLUtils
;
import
org.jkiss.dbeaver.model.DBUtils
;
import
org.jkiss.dbeaver.model.exec.DBCException
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionContextDefaults
;
import
org.jkiss.dbeaver.model.exec.DBCExecutionPurpose
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCPreparedStatement
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCRemoteInstance
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSSchema
;
import
org.jkiss.utils.CommonUtils
;
import
java.sql.SQLException
;
/**
* MySQLExecutionContext
*/
public
class
MySQLExecutionContext
extends
JDBCExecutionContext
implements
DBCExecutionContextDefaults
<
MySQLCatalog
,
DBSSchema
>
{
private
static
final
Log
log
=
Log
.
getLog
(
MySQLExecutionContext
.
class
);
//private MySQLCatalog activeDatabase;
private
String
activeDatabaseName
;
MySQLExecutionContext
(
@NotNull
JDBCRemoteInstance
instance
,
String
purpose
)
{
super
(
instance
,
purpose
);
}
@NotNull
@Override
public
MySQLDataSource
getDataSource
()
{
return
(
MySQLDataSource
)
super
.
getDataSource
();
}
@Nullable
@Override
public
DBCExecutionContextDefaults
getContextDefaults
()
{
return
this
;
}
public
String
getActiveDatabaseName
()
{
return
activeDatabaseName
;
}
@Override
public
MySQLCatalog
getDefaultCatalog
()
{
return
CommonUtils
.
isEmpty
(
activeDatabaseName
)
?
null
:
getDataSource
().
getCatalog
(
activeDatabaseName
);
}
@Override
public
DBSSchema
getDefaultSchema
()
{
return
null
;
}
@Override
public
boolean
supportsCatalogChange
()
{
return
true
;
}
@Override
public
boolean
supportsSchemaChange
()
{
return
false
;
}
@Override
public
void
setDefaultCatalog
(
DBRProgressMonitor
monitor
,
MySQLCatalog
catalog
,
DBSSchema
schema
)
throws
DBCException
{
if
(
activeDatabaseName
!=
null
&&
activeDatabaseName
.
equals
(
catalog
.
getName
()))
{
return
;
}
final
MySQLCatalog
oldActiveDatabase
=
getDefaultCatalog
();
if
(!
setCurrentDatabase
(
monitor
,
catalog
))
{
return
;
}
activeDatabaseName
=
catalog
.
getName
();
// Send notifications
if
(
oldActiveDatabase
!=
null
)
{
DBUtils
.
fireObjectSelect
(
oldActiveDatabase
,
false
);
}
DBUtils
.
fireObjectSelect
(
catalog
,
true
);
}
@Override
public
void
setDefaultSchema
(
DBRProgressMonitor
monitor
,
DBSSchema
schema
)
throws
DBCException
{
throw
new
DBCException
(
"Not supported"
);
}
@Override
public
boolean
refreshDefaults
(
DBRProgressMonitor
monitor
)
throws
DBException
{
// Check default active schema
try
(
JDBCSession
session
=
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Query active database"
))
{
activeDatabaseName
=
MySQLUtils
.
determineCurrentDatabase
(
session
);
}
catch
(
DBException
e
)
{
throw
new
DBCException
(
e
,
getDataSource
());
}
return
false
;
}
boolean
setCurrentDatabase
(
DBRProgressMonitor
monitor
,
MySQLCatalog
object
)
throws
DBCException
{
if
(
object
==
null
)
{
log
.
debug
(
"Null current database"
);
return
false
;
}
try
(
JDBCSession
session
=
openSession
(
monitor
,
DBCExecutionPurpose
.
UTIL
,
"Set active catalog"
))
{
try
(
JDBCPreparedStatement
dbStat
=
session
.
prepareStatement
(
"use "
+
DBUtils
.
getQuotedIdentifier
(
object
)))
{
dbStat
.
execute
();
}
this
.
activeDatabaseName
=
object
.
getName
();
return
true
;
}
catch
(
SQLException
e
)
{
throw
new
DBCException
(
e
,
getDataSource
());
}
}
}
plugins/org.jkiss.dbeaver.ext.mysql/src/org/jkiss/dbeaver/ext/mysql/model/MySQLStructureAssistant.java
浏览文件 @
0e67f09b
...
...
@@ -91,7 +91,7 @@ public class MySQLStructureAssistant extends JDBCStructureAssistant
{
MySQLCatalog
catalog
=
parentObject
instanceof
MySQLCatalog
?
(
MySQLCatalog
)
parentObject
:
null
;
if
(
catalog
==
null
&&
!
globalSearch
)
{
catalog
=
dataSource
.
getDefault
Object
();
catalog
=
dataSource
.
getDefault
Database
();
}
if
(
objectType
==
RelationalObjectType
.
TYPE_TABLE
)
{
findTablesByMask
(
session
,
catalog
,
objectNameMask
,
maxResults
,
references
);
...
...
plugins/org.jkiss.dbeaver.ext.oracle/src/org/jkiss/dbeaver/ext/oracle/model/OracleDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -200,7 +200,7 @@ public class OracleDataSource extends JDBCDataSource
}
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
{
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
if
(
outputReader
==
null
)
{
outputReader
=
new
OracleOutputReader
();
}
...
...
plugins/org.jkiss.dbeaver.ext.postgresql/src/org/jkiss/dbeaver/ext/postgresql/model/PostgreDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -194,18 +194,14 @@ public class PostgreDataSource extends JDBCDataSource implements DBSInstanceCont
return
new
PostgreExecutionContext
((
PostgreDatabase
)
instance
,
type
);
}
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
{
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
if
(
setActiveObject
)
{
final
PostgreSchema
activeSchema
=
getDefaultInstance
().
getActiveSchema
();
if
(
activeSchema
!=
null
)
{
((
PostgreExecutionContext
)
context
).
setDefaultSchema
(
monitor
,
activeSchema
);
}
}
else
{
try
{
((
PostgreExecutionContext
)
context
).
refreshDefaults
(
monitor
);
}
catch
(
DBException
e
)
{
throw
new
DBCException
(
"Error reading connection defaults"
);
}
((
PostgreExecutionContext
)
context
).
refreshDefaults
(
monitor
);
}
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
0e67f09b
...
...
@@ -281,7 +281,7 @@ public abstract class JDBCDataSource
}
*/
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DB
C
Exception
{
protected
void
initializeContextState
(
@NotNull
DBRProgressMonitor
monitor
,
@NotNull
JDBCExecutionContext
context
,
boolean
setActiveObject
)
throws
DBException
{
}
...
...
plugins/org.jkiss.dbeaver.model/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCExecutionContext.java
浏览文件 @
0e67f09b
...
...
@@ -138,6 +138,8 @@ public class JDBCExecutionContext extends AbstractExecutionContext<JDBCDataSourc
this
.
dataSource
.
initializeContextState
(
monitor
,
this
,
forceActiveObject
&&
!
connectionReadOnly
);
}
catch
(
DBCException
e
)
{
log
.
error
(
"Error while initializing context state"
,
e
);
}
catch
(
DBException
e
)
{
e
.
printStackTrace
();
}
try
{
...
...
plugins/org.jkiss.dbeaver.ui.editors.base/src/org/jkiss/dbeaver/ui/editors/EditorUtils.java
浏览文件 @
0e67f09b
...
...
@@ -177,7 +177,7 @@ public class EditorUtils {
if
(
dataSourceId
!=
null
)
{
DBPDataSourceContainer
dataSource
=
projectMeta
.
getDataSourceRegistry
().
getDataSource
(
dataSourceId
.
toString
());
if
(
dataSource
==
null
)
{
log
.
error
(
"Datasource "
+
dataSourceId
+
" not found in project "
+
projectMeta
.
getName
());
log
.
debug
(
"Datasource "
+
dataSourceId
+
" not found in project "
+
projectMeta
.
getName
());
}
return
dataSource
;
}
else
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录