Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
suliangchun
dbeaver
提交
f7420004
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,发现更多精彩内容 >>
提交
f7420004
编写于
6月 28, 2015
作者:
J
jurgen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
JDBC stored procedures execution
Former-commit-id:
6919c17d
上级
c38d9361
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
73 addition
and
62 deletion
+73
-62
docs/todo.txt
docs/todo.txt
+1
-0
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
...iss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
+15
-26
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
...src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
+42
-34
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCConnectionImpl.java
...kiss/dbeaver/model/impl/jdbc/exec/JDBCConnectionImpl.java
+5
-2
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2SQLDialect.java
...aver.db2/src/org/jkiss/dbeaver/ext/db2/DB2SQLDialect.java
+10
-0
未找到文件。
docs/todo.txt
浏览文件 @
f7420004
Procedures execute support (describe params + resultset)
DBeaver features usage model
Extract non-visual part to a separate plugin (preferences + editors)
RSV find/replace action
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/DBUtils.java
浏览文件 @
f7420004
...
...
@@ -829,6 +829,19 @@ public final class DBUtils {
statementType = DBCStatementType.EXEC;
}
*/
if
(
isExecQuery
(
session
,
query
))
{
statementType
=
DBCStatementType
.
EXEC
;
}
return
session
.
prepareStatement
(
statementType
,
query
,
scrollable
&&
session
.
getDataSource
().
getInfo
().
supportsResultSetScroll
(),
false
,
false
);
}
public
static
boolean
isExecQuery
(
DBCSession
session
,
String
query
)
{
DBPDataSource
dataSource
=
session
.
getDataSource
();
if
(
dataSource
instanceof
SQLDataSource
)
{
// Check for EXEC query
...
...
@@ -837,36 +850,12 @@ public final class DBUtils {
final
String
queryStart
=
SQLUtils
.
getFirstKeyword
(
query
);
for
(
String
keyword
:
executeKeywords
)
{
if
(
keyword
.
equalsIgnoreCase
(
queryStart
))
{
statementType
=
DBCStatementType
.
EXEC
;
break
;
}
}
}
}
/*
final DBCStatement statement = context.prepareStatement(statementType, query, false, false, false);
if (outParamName != null) {
if (statement instanceof CallableStatement) {
try {
if (outParamName.equals("?")) {
((CallableStatement)statement).registerOutParameter(1, java.sql.Types.OTHER);
} else {
((CallableStatement)statement).registerOutParameter(outParamName, java.sql.Types.OTHER);
return
true
;
}
} catch (SQLException e) {
throw new DBCException(e);
}
}
}
return statement;
*/
return
session
.
prepareStatement
(
statementType
,
query
,
scrollable
&&
dataSource
.
getInfo
().
supportsResultSetScroll
(),
false
,
false
);
return
false
;
}
public
static
void
fireObjectUpdate
(
DBSObject
object
)
...
...
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/JDBCDataSource.java
浏览文件 @
f7420004
...
...
@@ -28,6 +28,7 @@ import org.jkiss.dbeaver.model.*;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCDatabaseMetaData
;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCSession
;
import
org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCCallableStatementImpl
;
import
org.jkiss.dbeaver.model.impl.jdbc.exec.JDBCConnectionImpl
;
import
org.jkiss.dbeaver.model.meta.Property
;
import
org.jkiss.dbeaver.model.runtime.DBRProgressMonitor
;
...
...
@@ -38,6 +39,7 @@ import org.jkiss.dbeaver.model.struct.DBSDataSourceContainer;
import
org.jkiss.dbeaver.model.struct.DBSDataType
;
import
org.jkiss.dbeaver.model.struct.DBSObject
;
import
org.jkiss.dbeaver.model.struct.DBSObjectContainer
;
import
org.jkiss.dbeaver.model.struct.rdb.DBSProcedure
;
import
org.jkiss.dbeaver.runtime.RuntimeUtils
;
import
org.jkiss.utils.CommonUtils
;
...
...
@@ -175,40 +177,6 @@ public abstract class JDBCDataSource
}
}
protected
boolean
isConnectionReadOnlyBroken
()
{
return
false
;
}
protected
String
getConnectionUserName
(
DBPConnectionConfiguration
connectionInfo
)
{
return
connectionInfo
.
getUserName
();
}
protected
String
getConnectionUserPassword
(
DBPConnectionConfiguration
connectionInfo
)
{
return
connectionInfo
.
getUserPassword
();
}
protected
Driver
getDriverInstance
(
DBRProgressMonitor
monitor
)
throws
DBException
{
return
Driver
.
class
.
cast
(
container
.
getDriver
().
getDriverInstance
(
RuntimeUtils
.
makeContext
(
monitor
)
));
}
/**
* Could be overridden by extenders. May contain any additional connection properties.
* Note: these properties may be overwritten by connection advanced properties.
* @return predefined connection properties
*/
@Nullable
protected
Map
<
String
,
String
>
getInternalConnectionProperties
()
{
return
null
;
}
/*
@Override
public JDBCSession openSession(DBRProgressMonitor monitor, DBCExecutionPurpose purpose, String taskTitle)
...
...
@@ -467,6 +435,40 @@ public abstract class JDBCDataSource
/////////////////////////////////////////////////
// Overridable functions
protected
boolean
isConnectionReadOnlyBroken
()
{
return
false
;
}
protected
String
getConnectionUserName
(
DBPConnectionConfiguration
connectionInfo
)
{
return
connectionInfo
.
getUserName
();
}
protected
String
getConnectionUserPassword
(
DBPConnectionConfiguration
connectionInfo
)
{
return
connectionInfo
.
getUserPassword
();
}
protected
Driver
getDriverInstance
(
DBRProgressMonitor
monitor
)
throws
DBException
{
return
Driver
.
class
.
cast
(
container
.
getDriver
().
getDriverInstance
(
RuntimeUtils
.
makeContext
(
monitor
)
));
}
/**
* Could be overridden by extenders. May contain any additional connection properties.
* Note: these properties may be overwritten by connection advanced properties.
* @return predefined connection properties
*/
@Nullable
protected
Map
<
String
,
String
>
getInternalConnectionProperties
()
{
return
null
;
}
protected
DBPDataSourceInfo
createDataSourceInfo
(
JDBCDatabaseMetaData
metaData
)
{
return
new
JDBCDataSourceInfo
(
metaData
);
...
...
@@ -477,6 +479,11 @@ public abstract class JDBCDataSource
return
new
JDBCSQLDialect
(
this
,
"JDBC"
,
metaData
);
}
public
DBSProcedure
describeCall
(
JDBCCallableStatementImpl
call
)
{
String
queryString
=
call
.
getQueryString
();
return
null
;
}
/////////////////////////////////////////////////
// Error assistance
...
...
@@ -508,4 +515,5 @@ public abstract class JDBCDataSource
}
return
null
;
}
}
plugins/org.jkiss.dbeaver.core/src/org/jkiss/dbeaver/model/impl/jdbc/exec/JDBCConnectionImpl.java
浏览文件 @
f7420004
...
...
@@ -26,6 +26,7 @@ import org.jkiss.dbeaver.model.data.DBDValueHandler;
import
org.jkiss.dbeaver.model.exec.*
;
import
org.jkiss.dbeaver.model.exec.jdbc.*
;
import
org.jkiss.dbeaver.model.impl.AbstractSession
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCException
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCUtils
;
...
...
@@ -66,7 +67,7 @@ public class JDBCConnectionImpl extends AbstractSession implements JDBCSession,
}
@Override
public
DBP
DataSource
getDataSource
()
public
JDBC
DataSource
getDataSource
()
{
return
context
.
getDataSource
();
}
...
...
@@ -680,7 +681,9 @@ public class JDBCConnectionImpl extends AbstractSession implements JDBCSession,
if
(
original
==
null
)
{
throw
new
IllegalArgumentException
(
"Null statement"
);
}
return
new
JDBCCallableStatementImpl
(
this
,
original
,
sql
,
!
isLoggingEnabled
());
JDBCCallableStatementImpl
call
=
new
JDBCCallableStatementImpl
(
this
,
original
,
sql
,
!
isLoggingEnabled
());
getDataSource
().
describeCall
(
call
);
return
call
;
}
}
plugins/org.jkiss.dbeaver.db2/src/org/jkiss/dbeaver/ext/db2/DB2SQLDialect.java
浏览文件 @
f7420004
...
...
@@ -23,6 +23,9 @@ import org.jkiss.dbeaver.ext.db2.model.DB2DataSource;
import
org.jkiss.dbeaver.model.exec.jdbc.JDBCDatabaseMetaData
;
import
org.jkiss.dbeaver.model.impl.jdbc.JDBCSQLDialect
;
import
java.util.Collection
;
import
java.util.Collections
;
/**
* DB2 SQL dialect
*
...
...
@@ -46,4 +49,11 @@ public class DB2SQLDialect extends JDBCSQLDialect {
return
MultiValueInsertMode
.
GROUP_ROWS
;
}
@NotNull
@Override
public
Collection
<
String
>
getExecuteKeywords
()
{
return
Collections
.
singleton
(
"call"
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录