diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresCallMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresCallMetaDataProvider.java index b87f98346d..87fd3b9947 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresCallMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresCallMetaDataProvider.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2011 the original author or authors. + * Copyright 2002-2017 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -78,4 +78,5 @@ public class PostgresCallMetaDataProvider extends GenericCallMetaDataProvider { public boolean byPassReturnParameter(String parameterName) { return RETURN_VALUE_NAME.equals(parameterName); } + } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java b/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java index bec9ee5758..d1698d70eb 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/object/RdbmsOperation.java @@ -89,24 +89,24 @@ public abstract class RdbmsOperation implements InitializingBean { /** - * An alternative to the more commonly used setDataSource() when you want to - * use the same JdbcTemplate in multiple RdbmsOperations. This is appropriate if the - * JdbcTemplate has special configuration such as a SQLExceptionTranslator that should - * apply to multiple RdbmsOperation objects. + * An alternative to the more commonly used {@link #setDataSource} when you want to + * use the same {@link JdbcTemplate} in multiple {@code RdbmsOperations}. This is + * appropriate if the {@code JdbcTemplate} has special configuration such as a + * {@link org.springframework.jdbc.support.SQLExceptionTranslator} to be reused. */ public void setJdbcTemplate(JdbcTemplate jdbcTemplate) { this.jdbcTemplate = jdbcTemplate; } /** - * Return the JdbcTemplate object used by this object. + * Return the {@link JdbcTemplate} used by this operation object. */ public JdbcTemplate getJdbcTemplate() { return this.jdbcTemplate; } /** - * Set the JDBC DataSource to obtain connections from. + * Set the JDBC {@link DataSource} to obtain connections from. * @see org.springframework.jdbc.core.JdbcTemplate#setDataSource */ public void setDataSource(DataSource dataSource) { @@ -409,7 +409,7 @@ public abstract class RdbmsOperation implements InitializingBean { * Validate the named parameters passed to an execute method based on declared parameters. * Subclasses should invoke this method before every {@code executeQuery()} or * {@code update()} method. - * @param parameters parameter Map supplied. May be {@code null}. + * @param parameters parameter Map supplied (may be {@code null}) * @throws InvalidDataAccessApiUsageException if the parameters are invalid */ protected void validateNamedParameters(@Nullable Map parameters) throws InvalidDataAccessApiUsageException { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java index 1e080910d7..474907c687 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/lob/TemporaryLobCreator.java @@ -60,11 +60,15 @@ public class TemporaryLobCreator implements LobCreator { public void setBlobAsBytes(PreparedStatement ps, int paramIndex, @Nullable byte[] content) throws SQLException { - Blob blob = ps.getConnection().createBlob(); - blob.setBytes(1, content); - - this.temporaryBlobs.add(blob); - ps.setBlob(paramIndex, blob); + if (content != null) { + Blob blob = ps.getConnection().createBlob(); + blob.setBytes(1, content); + this.temporaryBlobs.add(blob); + ps.setBlob(paramIndex, blob); + } + else { + ps.setBlob(paramIndex, (Blob) null); + } if (logger.isDebugEnabled()) { logger.debug(content != null ? "Copied bytes into temporary BLOB with length " + content.length : @@ -103,11 +107,15 @@ public class TemporaryLobCreator implements LobCreator { public void setClobAsString(PreparedStatement ps, int paramIndex, @Nullable String content) throws SQLException { - Clob clob = ps.getConnection().createClob(); - clob.setString(1, content); - - this.temporaryClobs.add(clob); - ps.setClob(paramIndex, clob); + if (content != null) { + Clob clob = ps.getConnection().createClob(); + clob.setString(1, content); + this.temporaryClobs.add(clob); + ps.setClob(paramIndex, clob); + } + else { + ps.setClob(paramIndex, (Clob) null); + } if (logger.isDebugEnabled()) { logger.debug(content != null ? "Copied string into temporary CLOB with length " + content.length() : @@ -183,4 +191,5 @@ public class TemporaryLobCreator implements LobCreator { logger.error("Could not free LOB", ex); } } + } diff --git a/spring-jms/src/main/java/org/springframework/jms/listener/adapter/AbstractAdaptableMessageListener.java b/spring-jms/src/main/java/org/springframework/jms/listener/adapter/AbstractAdaptableMessageListener.java index 9ae3d41e5f..a6e8219e85 100644 --- a/spring-jms/src/main/java/org/springframework/jms/listener/adapter/AbstractAdaptableMessageListener.java +++ b/spring-jms/src/main/java/org/springframework/jms/listener/adapter/AbstractAdaptableMessageListener.java @@ -189,6 +189,7 @@ public abstract class AbstractAdaptableMessageListener /** * Return the {@link QosSettings} to use when sending a response, * or {@code null} if the defaults should be used. + * @since 5.0 */ @Nullable protected QosSettings getResponseQosSettings() {