1919package com .dtstack .flink .sql .sink .impala ;
2020
2121import com .dtstack .flink .sql .classloader .ClassLoaderManager ;
22+ import com .dtstack .flink .sql .core .rdb .util .JdbcConnectionUtil ;
2223import com .dtstack .flink .sql .exception .ExceptionTrace ;
2324import com .dtstack .flink .sql .factory .DTThreadFactory ;
2425import com .dtstack .flink .sql .outputformat .AbstractDtRichOutputFormat ;
2526import com .dtstack .flink .sql .sink .rdb .JDBCTypeConvertUtils ;
2627import com .dtstack .flink .sql .table .AbstractTableInfo ;
2728import com .dtstack .flink .sql .util .DtStringUtil ;
28- import com .dtstack .flink .sql .util .JDBCUtils ;
2929import com .dtstack .flink .sql .util .KrbUtils ;
3030import com .google .common .collect .Maps ;
3131import org .apache .commons .collections .CollectionUtils ;
@@ -283,8 +283,8 @@ private void executeUpdateBatch() throws SQLException {
283283 rows .clear ();
284284 } catch (Exception e ) {
285285 LOG .debug ("impala jdbc execute batch error " , e );
286- JDBCUtils .rollBack (connection );
287- JDBCUtils .commit (connection );
286+ JdbcConnectionUtil .rollBack (connection );
287+ JdbcConnectionUtil .commit (connection );
288288 updateStatement .clearBatch ();
289289 executeUpdate (connection );
290290 }
@@ -295,10 +295,10 @@ public void executeUpdate(Connection connection) {
295295 try {
296296 setRecordToStatement (updateStatement , JDBCTypeConvertUtils .getSqlTypeFromFieldType (fieldTypes ), row );
297297 updateStatement .executeUpdate ();
298- JDBCUtils .commit (connection );
298+ JdbcConnectionUtil .commit (connection );
299299 } catch (Exception e ) {
300- JDBCUtils .rollBack (connection );
301- JDBCUtils .commit (connection );
300+ JdbcConnectionUtil .rollBack (connection );
301+ JdbcConnectionUtil .commit (connection );
302302 if (metricOutputFormat .outDirtyRecords .getCount () % DIRTY_DATA_PRINT_FREQUENCY == 0 || LOG .isDebugEnabled ()) {
303303 LOG .error ("record insert failed ,this row is {}" , row .toString ());
304304 LOG .error ("" , e );
@@ -510,16 +510,16 @@ private void dealBatchSqlError(List<String> rowData,
510510 Statement statement ,
511511 String templateSql ) {
512512 String errorMsg = "Insert into impala error. \n Cause: [%s]\n Row: [%s]" ;
513- JDBCUtils .rollBack (connection );
514- JDBCUtils .commit (connection );
513+ JdbcConnectionUtil .rollBack (connection );
514+ JdbcConnectionUtil .commit (connection );
515515 for (String rowDatum : rowData ) {
516516 String executeSql = templateSql .replace (VALUES_CONDITION , rowDatum );
517517 try {
518518 statement .execute (executeSql );
519- JDBCUtils .commit (connection );
519+ JdbcConnectionUtil .commit (connection );
520520 } catch (SQLException e ) {
521- JDBCUtils .rollBack (connection );
522- JDBCUtils .commit (connection );
521+ JdbcConnectionUtil .rollBack (connection );
522+ JdbcConnectionUtil .commit (connection );
523523 if (metricOutputFormat .outDirtyRecords .getCount () % DIRTY_DATA_PRINT_FREQUENCY == 0 || LOG .isDebugEnabled ()) {
524524 LOG .error (
525525 String .format (
0 commit comments