Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
493d6d1b
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,发现更多精彩内容 >>
提交
493d6d1b
编写于
6月 29, 2015
作者:
T
titou10
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
DB2: DDL generation is not allowed for table with space in their name (breaks db2look SP..)
上级
4a248439
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
24 addition
and
8 deletion
+24
-8
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Messages.java
...beaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Messages.java
+1
-0
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Resources.properties
...db2/src/org/jkiss/dbeaver/ext/db2/DB2Resources.properties
+1
-0
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Utils.java
...s.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Utils.java
+22
-8
未找到文件。
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Messages.java
浏览文件 @
493d6d1b
...
...
@@ -149,6 +149,7 @@ public class DB2Messages extends NLS {
public
static
String
no_ddl_for_system_tables
;
public
static
String
no_ddl_for_nicknames
;
public
static
String
no_ddl_for_nonsql_routines
;
public
static
String
no_ddl_for_spaces_in_name
;
public
static
String
dialog_tools_msg_title
;
public
static
String
dialog_tools_msg_code
;
...
...
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Resources.properties
浏览文件 @
493d6d1b
...
...
@@ -131,6 +131,7 @@ dialog_table_tools_truncate_triggers_restrict=Restrict When Delete Triggers
no_ddl_for_system_tables
=
DDL is not available for System Tables
no_ddl_for_nicknames
=
DDL is not available for Nicknames
no_ddl_for_nonsql_routines
=
DDL is not available for non-SQL based Routines
no_ddl_for_spaces_in_name
=
DDL is not available for Object that have a whitespace in their name or Schema
dialog_tools_msg_title
=
Retrieve SQL Message from SQL Code
dialog_tools_msg_code
=
SQL Code?
...
...
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2Utils.java
浏览文件 @
493d6d1b
...
...
@@ -48,8 +48,8 @@ import org.jkiss.dbeaver.model.exec.jdbc.JDBCResultSet;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
import
org.jkiss.dbeaver.model.sql.SQLUtils
;
import
org.jkiss.dbeaver.model.runtime.VoidProgressMonitor
;
import
org.jkiss.dbeaver.model.sql.SQLUtils
;
import
java.sql.Clob
;
import
java.sql.SQLException
;
...
...
@@ -151,6 +151,17 @@ public class DB2Utils {
return
DB2Messages
.
no_ddl_for_system_tables
;
}
// The DB2LK_GENERATE_DDL SP does not work when the name contains a space, even after trying to apply what is sais in the
// doc:
// As a workaround, dipslay a message to the end-user
// Enclose multiword table names with the backslash and two sets of double quotation marks (for example, "\"My Table\"")
// to prevent the pairing from being evaluated word-by-word by the command line processor (CLP).
// If you use only one set of double quotation marks (for example, "My Table"), all words are converted into uppercase,
// and the db2look command looks for an uppercase table name (for example, MY TABLE).
if
(
db2Table
.
getFullQualifiedName
().
contains
(
" "
))
{
return
DB2Messages
.
no_ddl_for_spaces_in_name
;
}
monitor
.
beginTask
(
"Generating DDL"
,
3
);
Integer
token
=
0
;
...
...
@@ -228,7 +239,8 @@ public class DB2Utils {
public
static
String
getMessageFromCode
(
DB2DataSource
db2DataSource
,
Integer
sqlErrorCode
)
throws
SQLException
{
JDBCSession
session
=
db2DataSource
.
getDefaultContext
(
false
).
openSession
(
VoidProgressMonitor
.
INSTANCE
,
DBCExecutionPurpose
.
UTIL
,
"Get Error Code"
);
JDBCSession
session
=
db2DataSource
.
getDefaultContext
(
false
).
openSession
(
VoidProgressMonitor
.
INSTANCE
,
DBCExecutionPurpose
.
UTIL
,
"Get Error Code"
);
return
JDBCUtils
.
queryString
(
session
,
GET_MSG
,
sqlErrorCode
);
}
...
...
@@ -265,7 +277,8 @@ public class DB2Utils {
monitor
.
beginTask
(
"Check EXPLAIN tables"
,
1
);
JDBCSession
session
=
dataSource
.
getDefaultContext
(
true
).
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Verify EXPLAIN tables"
);
JDBCSession
session
=
dataSource
.
getDefaultContext
(
true
).
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Verify EXPLAIN tables"
);
try
{
// First Check with given schema
...
...
@@ -304,7 +317,8 @@ public class DB2Utils {
monitor
.
beginTask
(
"Create EXPLAIN Tables"
,
1
);
JDBCSession
session
=
dataSource
.
getDefaultContext
(
true
).
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Create EXPLAIN tables"
);
JDBCSession
session
=
dataSource
.
getDefaultContext
(
true
).
openSession
(
monitor
,
DBCExecutionPurpose
.
META
,
"Create EXPLAIN tables"
);
try
{
JDBCCallableStatement
stmtSP
=
session
.
prepareCall
(
CALL_INST_OBJ
);
try
{
...
...
@@ -449,8 +463,8 @@ public class DB2Utils {
return
null
;
}
public
static
DB2TableColumn
findColumnxBySchemaNameAndTableNameAndName
(
DBRProgressMonitor
monitor
,
DB2DataSource
db2DataSource
,
String
db2SchemaName
,
String
db2TableName
,
String
db2ColumnName
)
throws
DBException
public
static
DB2TableColumn
findColumnxBySchemaNameAndTableNameAndName
(
DBRProgressMonitor
monitor
,
DB2DataSource
db2DataSource
,
String
db2SchemaName
,
String
db2TableName
,
String
db2ColumnName
)
throws
DBException
{
DB2Schema
db2Schema
=
db2DataSource
.
getSchema
(
monitor
,
db2SchemaName
);
if
(
db2Schema
==
null
)
{
...
...
@@ -563,8 +577,8 @@ public class DB2Utils {
return
db2Schema
.
getUDF
(
monitor
,
db2FunctionName
);
}
public
static
DB2View
findViewBySchemaNameAndName
(
DBRProgressMonitor
monitor
,
DB2DataSource
db2DataSource
,
String
db2
SchemaName
,
String
db2
ViewName
)
throws
DBException
public
static
DB2View
findViewBySchemaNameAndName
(
DBRProgressMonitor
monitor
,
DB2DataSource
db2DataSource
,
String
db2SchemaName
,
String
db2ViewName
)
throws
DBException
{
DB2Schema
db2Schema
=
db2DataSource
.
getSchema
(
monitor
,
db2SchemaName
);
if
(
db2Schema
==
null
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录