diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java b/spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java index 3cc779b1976..562140faf02 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/IncorrectResultSetColumnCountException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2024 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. @@ -20,7 +20,7 @@ import org.springframework.dao.DataRetrievalFailureException; /** * Data access exception thrown when a result set did not have the correct column count, - * for example when expecting a single column but getting 0 or more than 1 columns. + * for example when expecting a single column but getting 0 or more than 1 column. * * @author Juergen Hoeller * @since 2.0 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java b/spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java index 4b88b4159fa..d7549b0f5cf 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/JdbcUpdateAffectedIncorrectNumberOfRowsException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2024 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. @@ -20,7 +20,7 @@ import org.springframework.dao.IncorrectUpdateSemanticsDataAccessException; /** * Exception thrown when a JDBC update affects an unexpected number of rows. - * Typically we expect an update to affect a single row, meaning it's an + * Typically, we expect an update to affect a single row, meaning it is an * error if it affects multiple rows. * * @author Rod Johnson diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/InterruptibleBatchPreparedStatementSetter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/InterruptibleBatchPreparedStatementSetter.java index 9de0357d641..9a304e1cf11 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/InterruptibleBatchPreparedStatementSetter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/InterruptibleBatchPreparedStatementSetter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2024 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. @@ -22,7 +22,7 @@ package org.springframework.jdbc.core; * *
This interface allows you to signal the end of a batch rather than * having to determine the exact batch size upfront. Batch size is still - * being honored but it is now the maximum size of the batch. + * being honored, but it is now the maximum size of the batch. * *
The {@link #isBatchExhausted} method is called after each call to * {@link #setValues} to determine whether there were some values added, 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 cba88a46040..fe7b05b1113 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2020 the original author or authors. + * Copyright 2002-2024 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. @@ -128,8 +128,8 @@ public abstract class RdbmsOperation implements InitializingBean { /** * Set the maximum number of rows for this RDBMS operation. This is important - * for processing subsets of large result sets, avoiding to read and hold - * the entire result set in the database or in the JDBC driver. + * for processing subsets of large result sets, in order to avoid reading and + * holding the entire result set in the database or in the JDBC driver. *
Default is -1, indicating to use the driver's default. * @see org.springframework.jdbc.core.JdbcTemplate#setMaxRows */ @@ -175,7 +175,7 @@ public abstract class RdbmsOperation implements InitializingBean { public void setUpdatableResults(boolean updatableResults) { if (isCompiled()) { throw new InvalidDataAccessApiUsageException( - "The updateableResults flag must be set before the operation is compiled"); + "The updatableResults flag must be set before the operation is compiled"); } this.updatableResults = updatableResults; } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java b/spring-jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java index f740eb4b792..d860eb206bd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2024 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. @@ -29,7 +29,7 @@ import org.springframework.jdbc.core.SqlParameter; /** * Superclass for object abstractions of RDBMS stored procedures. - * This class is abstract and it is intended that subclasses will provide a typed + * This class is abstract, and it is intended that subclasses will provide a typed * method for invocation that delegates to the supplied {@link #execute} method. * *
The inherited {@link #setSql sql} property is the name of the stored procedure diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java index 2908e65bac3..259353a04f7 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/CustomSQLExceptionTranslatorRegistry.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2024 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. @@ -25,9 +25,9 @@ import org.apache.commons.logging.LogFactory; import org.springframework.lang.Nullable; /** - * Registry for custom {@link org.springframework.jdbc.support.SQLExceptionTranslator} instances associated with - * specific databases allowing for overriding translation based on values contained in the configuration file - * named "sql-error-codes.xml". + * Registry for custom {@link SQLExceptionTranslator} instances associated with + * specific databases allowing for overriding translation based on values + * contained in the configuration file named "sql-error-codes.xml". * * @author Thomas Risberg * @since 3.1.1 @@ -38,7 +38,7 @@ public final class CustomSQLExceptionTranslatorRegistry { private static final Log logger = LogFactory.getLog(CustomSQLExceptionTranslatorRegistry.class); /** - * Keep track of a single instance so we can return it to classes that request it. + * Keep track of a single instance, so we can return it to classes that request it. */ private static final CustomSQLExceptionTranslatorRegistry instance = new CustomSQLExceptionTranslatorRegistry(); 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 fb42d833a4f..3c6580d0d45 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 @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 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. @@ -219,7 +219,7 @@ public abstract class JdbcUtils { return NumberUtils.convertNumberToTargetClass(number, Integer.class); } else { - // e.g. on Postgres: getObject returns a PGObject but we need a String + // e.g. on Postgres: getObject returns a PGObject, but we need a String return rs.getString(index); } } @@ -415,14 +415,14 @@ public abstract class JdbcUtils { } /** - * Return whether the given JDBC driver supports JDBC 2.0 batch updates. + * Return whether the given JDBC driver supports JDBC batch updates. *
Typically invoked right before execution of a given set of statements: * to decide whether the set of SQL statements should be executed through - * the JDBC 2.0 batch mechanism or simply in a traditional one-by-one fashion. + * the JDBC batch mechanism or simply in a traditional one-by-one fashion. *
Logs a warning if the "supportsBatchUpdates" methods throws an exception * and simply returns {@code false} in that case. * @param con the Connection to check - * @return whether JDBC 2.0 batch updates are supported + * @return whether JDBC batch updates are supported * @see java.sql.DatabaseMetaData#supportsBatchUpdates() */ public static boolean supportsBatchUpdates(Connection con) { @@ -492,8 +492,8 @@ public abstract class JdbcUtils { /** * Determine the column name to use. The column name is determined based on a * lookup using ResultSetMetaData. - *
This method implementation takes into account recent clarifications - * expressed in the JDBC 4.0 specification: + *
This method's implementation takes into account clarifications expressed + * in the JDBC 4.0 specification: *
columnLabel - the label for the column specified with the SQL AS clause. * If the SQL AS clause was not specified, then the label is the name of the column. * @param resultSetMetaData the current meta-data to use diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java index 12e8ba6cc3c..66759edeeec 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodesFactory.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2022 the original author or authors. + * Copyright 2002-2024 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. @@ -67,7 +67,7 @@ public class SQLErrorCodesFactory { private static final Log logger = LogFactory.getLog(SQLErrorCodesFactory.class); /** - * Keep track of a single instance so we can return it to classes that request it. + * Keep track of a single instance, so we can return it to classes that request it. * Lazily initialized in order to avoid making {@code SQLErrorCodesFactory} constructor * reachable on native images when not needed. */ diff --git a/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java b/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java index 70689977cd2..2eb1749da9e 100644 --- a/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java +++ b/spring-tx/src/main/java/org/springframework/dao/IncorrectUpdateSemanticsDataAccessException.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2024 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. @@ -44,10 +44,11 @@ public class IncorrectUpdateSemanticsDataAccessException extends InvalidDataAcce super(msg, cause); } + /** * Return whether data was updated. - * If this method returns false, there's nothing to roll back. - *
The default implementation always returns true. + * If this method returns {@code false}, there is nothing to roll back. + *
The default implementation always returns {@code true}. * This can be overridden in subclasses. */ public boolean wasDataUpdated() {