BenJFan commented on code in PR #1926:
URL: 
https://github.com/apache/incubator-seatunnel/pull/1926#discussion_r878637282


##########
seatunnel-connectors/seatunnel-connectors-flink/seatunnel-connector-flink-jdbc/src/main/java/org/apache/seatunnel/flink/jdbc/source/JdbcSource.java:
##########
@@ -194,10 +195,12 @@ private Map<String, TypeInformation<?>> 
initTableField(Connection connection, St
             String databaseDialect = 
connection.getMetaData().getDatabaseProductName();
             PreparedStatement preparedStatement = 
connection.prepareStatement(selectSql, ResultSet.TYPE_FORWARD_ONLY, 
ResultSet.CONCUR_READ_ONLY);
             preparedStatement.setMaxRows(1);
-            ResultSetMetaData rsMeta = preparedStatement.getMetaData();
             try {
+                //support PreparedStatement getMetaData()
+                ResultSetMetaData rsMeta = preparedStatement.getMetaData();
                 return getRowInfo(rsMeta, databaseDialect);
             } catch (SQLException e) {
+                //not support PreparedStatement getMetaData() and use 
ResultSet getMetaData()

Review Comment:
   Not only getMetaData will throw SQLException, maybe other reason will 
execute this code. If that, the Exception will throw again, please make sure 
this logic execute in right time.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to