yzeng1618 commented on code in PR #10048:
URL: https://github.com/apache/seatunnel/pull/10048#discussion_r2544128937


##########
seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/utils/JdbcFieldTypeUtils.java:
##########
@@ -95,12 +100,135 @@ public static byte[] getBytes(ResultSet resultSet, int 
columnIndex) throws SQLEx
         return resultSet.getBytes(columnIndex);
     }
 
+    public static OffsetDateTime getOffsetDateTime(ResultSet resultSet, int 
columnIndex)
+            throws SQLException {
+        final Object obj = resultSet.getObject(columnIndex);
+        if (obj == null) {
+            return null;
+        }
+
+        // Handle Oracle proprietary TIMESTAMP WITH TIME ZONE types
+        // oracle.sql.TIMESTAMPTZ - TIMESTAMP WITH TIME ZONE
+        // oracle.sql.TIMESTAMPLTZ - TIMESTAMP WITH LOCAL TIME ZONE
+        String className = obj.getClass().getName();
+        if ("oracle.sql.TIMESTAMPTZ".equals(className)
+                || "oracle.sql.TIMESTAMPLTZ".equals(className)) {
+            try {
+                // Use reflection to call toOffsetDateTime() or 
offsetDateTimeValue() method
+                // These methods are available in Oracle JDBC driver
+                java.lang.reflect.Method toOffsetDateTimeMethod = null;
+                try {
+                    // Try toOffsetDateTime() first (no connection required)
+                    toOffsetDateTimeMethod = 
obj.getClass().getMethod("toOffsetDateTime");
+                    return (OffsetDateTime) toOffsetDateTimeMethod.invoke(obj);

Review Comment:
   This PR focuses on PostgreSQL only; the Oracle‑specific reflection logic has 
been removed from JdbcFieldTypeUtils and will be re‑introduced with caching in 
a separate Oracle support branch/PR.



-- 
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