mirror of
https://github.com/alibaba/DataX.git
synced 2025-05-02 23:52:00 +08:00
Merge pull request #1730 from yifanzheng/hotfix-issue#668
fix: issue(#668)修复连接未关闭问题
This commit is contained in:
commit
a4743c60da
@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import java.sql.Connection;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -120,9 +121,15 @@ public final class OriginalConfPretreatmentUtil {
|
|||||||
} else {
|
} else {
|
||||||
// 确保用户配置的 column 不重复
|
// 确保用户配置的 column 不重复
|
||||||
ListUtil.makeSureNoValueDuplicate(userConfiguredColumns, false);
|
ListUtil.makeSureNoValueDuplicate(userConfiguredColumns, false);
|
||||||
|
Connection connection = null;
|
||||||
|
try {
|
||||||
|
connection = connectionFactory.getConnecttion();
|
||||||
|
// 检查列是否都为数据库表中正确的列(通过执行一次 select column from table 进行判断)
|
||||||
|
DBUtil.getColumnMetaData(connection, oneTable,StringUtils.join(userConfiguredColumns, ","));
|
||||||
|
} finally {
|
||||||
|
DBUtil.closeDBResources(null, connection);
|
||||||
|
}
|
||||||
|
|
||||||
// 检查列是否都为数据库表中正确的列(通过执行一次 select column from table 进行判断)
|
|
||||||
DBUtil.getColumnMetaData(connectionFactory.getConnecttion(), oneTable,StringUtils.join(userConfiguredColumns, ","));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user