From dedb04bd5c611d098053d94233b848db5e9f40b2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Sun, 7 Sep 2014 22:43:09 +0200 Subject: [PATCH] Workaround for Derby's limited support for JDBC 4.1 getObject(index, requiredType) Issue: SPR-12157 --- .../main/java/org/springframework/jdbc/support/JdbcUtils.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java index 0b50a3a660..89e9b03180 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcUtils.java @@ -25,6 +25,7 @@ import java.sql.Connection; import java.sql.DatabaseMetaData; import java.sql.ResultSet; import java.sql.ResultSetMetaData; +import java.sql.SQLDataException; import java.sql.SQLException; import java.sql.SQLFeatureNotSupportedException; import java.sql.Statement; @@ -196,6 +197,9 @@ public abstract class JdbcUtils { try { return rs.getObject(index, requiredType); } + catch (SQLDataException ex) { + logger.debug("JDBC driver has limited support for JDBC 4.1 'getObject(int, Class)' method", ex); + } catch (SQLFeatureNotSupportedException ex) { logger.debug("JDBC driver does not support JDBC 4.1 'getObject(int, Class)' method", ex); }