Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
S
seatunnel-web
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
图表
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
宋勇
seatunnel-web
Commits
116694d1
提交
116694d1
authored
4月 14, 2024
作者:
宋勇
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
修改jdbc 主键bug
上级
4223d469
隐藏空白字符变更
内嵌
并排
正在显示
2 个修改的文件
包含
10 行增加
和
9 行删除
+10
-9
AccessJdbcDataSourceChannel.java
...ource/plugin/access/jdbc/AccessJdbcDataSourceChannel.java
+4
-4
DamengJdbcDataSourceChannel.java
...ource/plugin/demeng/jdbc/DamengJdbcDataSourceChannel.java
+6
-5
没有找到文件。
seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-access/src/main/java/org/apache/seatunnel/datasource/plugin/access/jdbc/AccessJdbcDataSourceChannel.java
浏览文件 @
116694d1
...
...
@@ -160,7 +160,7 @@ public class AccessJdbcDataSourceChannel implements DataSourceChannelExt {
List
<
TableField
>
tableFields
=
new
ArrayList
<>();
try
(
Connection
connection
=
getConnection
(
requestParams
,
database
))
{
DatabaseMetaData
metaData
=
connection
.
getMetaData
();
String
primaryKey
=
getPrimaryKey
(
metaData
,
database
,
table
);
//
String primaryKey = getPrimaryKey(metaData, database, table);
String
sql
=
"select * from INFORMATION_SCHEMA.SYSTEM_columns where TABLE_NAME='"
...
...
@@ -172,9 +172,9 @@ public class AccessJdbcDataSourceChannel implements DataSourceChannelExt {
TableField
tableField
=
new
TableField
();
String
columnName
=
resultSet
.
getString
(
"COLUMN_NAME"
);
tableField
.
setPrimaryKey
(
false
);
if
(
StringUtils
.
isNotBlank
(
primaryKey
)
&&
primaryKey
.
equals
(
columnName
))
{
tableField
.
setPrimaryKey
(
true
);
}
//
if (StringUtils.isNotBlank(primaryKey) && primaryKey.equals(columnName)) {
//
tableField.setPrimaryKey(true);
//
}
tableField
.
setType
(
resultSet
.
getString
(
"TYPE_NAME"
));
if
(
typeList
.
contains
(
tableField
.
getType
().
toLowerCase
()))
{
if
(
tableField
.
getType
().
toLowerCase
().
indexOf
(
"text"
)
<
0
)
{
...
...
seatunnel-datasource/seatunnel-datasource-plugins/datasource-jdbc-dameng/src/main/java/org/apache/seatunnel/datasource/plugin/demeng/jdbc/DamengJdbcDataSourceChannel.java
浏览文件 @
116694d1
...
...
@@ -167,7 +167,7 @@ public class DamengJdbcDataSourceChannel implements DataSourceChannelExt {
List
<
TableField
>
tableFields
=
new
ArrayList
<>();
try
(
Connection
connection
=
getConnection
(
requestParams
,
database
))
{
DatabaseMetaData
metaData
=
connection
.
getMetaData
();
String
primaryKey
=
getPrimaryKey
(
metaData
,
database
,
table
);
//
String primaryKey = getPrimaryKey(metaData, database, table);
String
sql
=
" select * from SYSCOLUMNS where id in (select id from SYSOBJECTS where name='"
...
...
@@ -179,9 +179,10 @@ public class DamengJdbcDataSourceChannel implements DataSourceChannelExt {
TableField
tableField
=
new
TableField
();
String
columnName
=
resultSet
.
getString
(
"NAME"
);
tableField
.
setPrimaryKey
(
false
);
if
(
StringUtils
.
isNotBlank
(
primaryKey
)
&&
primaryKey
.
equals
(
columnName
))
{
tableField
.
setPrimaryKey
(
true
);
}
// if (StringUtils.isNotBlank(primaryKey) && primaryKey.equals(columnName)) {
// tableField.setPrimaryKey(true);
// }
tableField
.
setType
(
resultSet
.
getString
(
"TYPE$"
));
if
(
typeList
.
contains
(
tableField
.
getType
().
toLowerCase
()))
{
if
(
tableField
.
getType
().
toLowerCase
().
indexOf
(
"text"
)
<
0
)
{
...
...
@@ -193,7 +194,7 @@ public class DamengJdbcDataSourceChannel implements DataSourceChannelExt {
}
String
extra
=
resultSet
.
getString
(
"INFO2"
);
if
(
StringUtils
.
isNotBlank
(
extra
)
&&
extra
.
trim
().
equals
(
"1"
))
{
tableField
.
set
HasAutoIncrement
(
true
);
tableField
.
set
PrimaryKey
(
true
);
}
tableField
.
setName
(
columnName
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论