Skip to content

Commit

Permalink
modify inner class JDBCConnection to uplevel public
Browse files Browse the repository at this point in the history
  • Loading branch information
baisui1981 committed Oct 7, 2024
1 parent a39f4c0 commit 57a0dba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import com.alibaba.datax.plugin.rdbms.util.RdbmsException;
import com.google.common.collect.Lists;
import com.qlangtech.tis.plugin.ds.ColumnMetaData;
import com.qlangtech.tis.plugin.ds.DataSourceMeta.JDBCConnection;
import com.qlangtech.tis.plugin.ds.JDBCConnection;
import com.qlangtech.tis.plugin.ds.IDataSourceFactoryGetter;
import com.qlangtech.tis.plugin.ds.RdbmsRunningContext;
import com.qlangtech.tis.plugin.ds.TableNotFoundException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import com.qlangtech.tis.plugin.ds.DataSourceMeta;
import com.qlangtech.tis.plugin.ds.IDBReservedKeys;
import com.qlangtech.tis.plugin.ds.IDataSourceFactoryGetter;
import com.qlangtech.tis.plugin.ds.JDBCConnection;
import com.qlangtech.tis.plugin.ds.TableNotFoundException;
import com.qlangtech.tis.sql.parser.tuple.creator.EntityName;
import org.apache.commons.lang3.StringUtils;
Expand Down Expand Up @@ -616,7 +617,7 @@ public static List<ColumnMetaData> getColumnMetaData(
* @return Left:ColumnName Middle:ColumnType Right:ColumnTypeName
*/
public static List<ColumnMetaData> getColumnMetaData(
Optional<DataSourceMeta.JDBCConnection> connection, boolean inSink, IDataSourceFactoryGetter dsGetter, SelectTable tableName, SelectCols userConfiguredColumns) {
Optional<JDBCConnection> connection, boolean inSink, IDataSourceFactoryGetter dsGetter, SelectTable tableName, SelectCols userConfiguredColumns) {

Map<String, ColumnMetaData> colMapper = null;
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import com.qlangtech.tis.plugin.ds.ColumnMetaData;
import com.qlangtech.tis.plugin.ds.DataSourceMeta;
import com.qlangtech.tis.plugin.ds.IDataSourceFactoryGetter;
import com.qlangtech.tis.plugin.ds.JDBCConnection;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.tuple.Pair;
Expand Down Expand Up @@ -462,7 +463,7 @@ private IStatementSetter parseColSetter(ColumnMetaData cm) {


public void startWriteWithConnection(RecordReceiver recordReceiver, TaskPluginCollector taskPluginCollector,
DataSourceMeta.JDBCConnection connection) {
JDBCConnection connection) {
this.taskPluginCollector = taskPluginCollector;

// 用于写入数据的时候的类型根据目的表字段类型转换
Expand Down Expand Up @@ -517,7 +518,7 @@ public void startWrite(RecordReceiver recordReceiver, Configuration writerSliceC
password);
DBUtil.dealWithSessionConfig(connection, writerSliceConfig, this.dataBaseType, BASIC_MESSAGE);
startWriteWithConnection(recordReceiver, taskPluginCollector,
new DataSourceMeta.JDBCConnection(connection, this.jdbcUrl));
new JDBCConnection(connection, this.jdbcUrl));
}


Expand All @@ -544,7 +545,7 @@ public void destroy(Configuration writerSliceConfig) {
private static final int MAX_BATCH_INSERT_COUNT = 30;
int batchInsertFaildCount = 0;

protected void doBatchInsert(DataSourceMeta.JDBCConnection conn, List<Record> buffer) throws SQLException {
protected void doBatchInsert(JDBCConnection conn, List<Record> buffer) throws SQLException {
Connection connection = conn.getConnection();
PreparedStatement preparedStatement = null;
try {
Expand Down

0 comments on commit 57a0dba

Please sign in to comment.