Skip to content

Commit e012b49

Browse files
committed
jdbc safe connect
1 parent fa84246 commit e012b49

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

rdb/rdb-sink/src/main/java/com/dtstack/flink/sql/sink/rdb/format/RetractJDBCOutputFormat.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
package com.dtstack.flink.sql.sink.rdb.format;
2020

2121
import com.dtstack.flink.sql.sink.rdb.RdbSink;
22+
import com.dtstack.flink.sql.util.JDBCUtils;
2223
import org.apache.commons.lang3.StringUtils;
2324
import org.apache.flink.api.java.tuple.Tuple2;
2425
import org.apache.flink.configuration.Configuration;
@@ -136,7 +137,7 @@ public void open(int taskNumber, int numTasks) throws IOException {
136137

137138
private Connection establishConnection() throws SQLException, ClassNotFoundException {
138139
Connection connection ;
139-
Class.forName(drivername);
140+
JDBCUtils.forName(drivername, getClass().getClassLoader());
140141
if (username == null) {
141142
connection = DriverManager.getConnection(dbURL);
142143
} else {

0 commit comments

Comments
 (0)