Polishing (backported from 5.2.x)
This commit is contained in:
@@ -29,7 +29,7 @@ public interface DisposableSqlTypeValue extends SqlTypeValue {
|
||||
|
||||
/**
|
||||
* Clean up resources held by this type value,
|
||||
* for example the LobCreator in case of a SqlLobValue.
|
||||
* for example the LobCreator in case of an SqlLobValue.
|
||||
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
|
||||
* @see org.springframework.jdbc.support.SqlValue#cleanup()
|
||||
*/
|
||||
|
||||
@@ -223,7 +223,7 @@ public interface JdbcOperations {
|
||||
List<Map<String, Object>> queryForList(String sql) throws DataAccessException;
|
||||
|
||||
/**
|
||||
* Execute a query for a SqlRowSet, given static SQL.
|
||||
* Execute a query for an SqlRowSet, given static SQL.
|
||||
* <p>Uses a JDBC Statement, not a PreparedStatement. If you want to
|
||||
* execute a static query with a PreparedStatement, use the overloaded
|
||||
* {@code queryForRowSet} method with {@code null} as argument array.
|
||||
@@ -234,7 +234,7 @@ public interface JdbcOperations {
|
||||
* class is used, which is part of JDK 1.5+ and also available separately as part of
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* @param sql the SQL query to execute
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForRowSet(String, Object...)
|
||||
@@ -775,7 +775,7 @@ public interface JdbcOperations {
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a list of
|
||||
* arguments to bind to the query, expecting a SqlRowSet.
|
||||
* arguments to bind to the query, expecting an SqlRowSet.
|
||||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
@@ -786,7 +786,7 @@ public interface JdbcOperations {
|
||||
* @param args arguments to bind to the query
|
||||
* @param argTypes the SQL types of the arguments
|
||||
* (constants from {@code java.sql.Types})
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForRowSet(String)
|
||||
@@ -798,7 +798,7 @@ public interface JdbcOperations {
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a list of
|
||||
* arguments to bind to the query, expecting a SqlRowSet.
|
||||
* arguments to bind to the query, expecting an SqlRowSet.
|
||||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
@@ -810,7 +810,7 @@ public interface JdbcOperations {
|
||||
* (leaving it to the PreparedStatement to guess the corresponding SQL type);
|
||||
* may also contain {@link SqlParameterValue} objects which indicate not
|
||||
* only the argument value but also the SQL type and optionally the scale
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see #queryForRowSet(String)
|
||||
@@ -982,7 +982,7 @@ public interface JdbcOperations {
|
||||
<T> T execute(String callString, CallableStatementCallback<T> action) throws DataAccessException;
|
||||
|
||||
/**
|
||||
* Execute a SQL call using a CallableStatementCreator to provide SQL and
|
||||
* Execute an SQL call using a CallableStatementCreator to provide SQL and
|
||||
* any required parameters.
|
||||
* @param csc a callback that provides SQL and any necessary parameters
|
||||
* @param declaredParameters list of declared SqlParameter objects
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2019 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -183,7 +183,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
/**
|
||||
* Set whether or not we want to ignore SQLWarnings.
|
||||
* <p>Default is "true", swallowing and logging all warnings. Switch this flag
|
||||
* to "false" to make the JdbcTemplate throw a SQLWarningException instead.
|
||||
* to "false" to make the JdbcTemplate throw an SQLWarningException instead.
|
||||
* @see java.sql.SQLWarning
|
||||
* @see org.springframework.jdbc.SQLWarningException
|
||||
* @see #handleWarnings
|
||||
@@ -1396,7 +1396,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw a SQLWarningException if we're not ignoring warnings,
|
||||
* Throw an SQLWarningException if we're not ignoring warnings,
|
||||
* otherwise log the warnings at debug level.
|
||||
* @param stmt the current JDBC statement
|
||||
* @throws SQLWarningException if not ignoring warnings
|
||||
@@ -1419,7 +1419,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
}
|
||||
|
||||
/**
|
||||
* Throw a SQLWarningException if encountering an actual warning.
|
||||
* Throw an SQLWarningException if encountering an actual warning.
|
||||
* @param warning the warnings object from the current statement.
|
||||
* May be {@code null}, in which case this method does nothing.
|
||||
* @throws SQLWarningException in case of an actual warning to be raised
|
||||
@@ -1447,7 +1447,7 @@ public class JdbcTemplate extends JdbcAccessor implements JdbcOperations {
|
||||
|
||||
/**
|
||||
* Determine SQL from potential provider object.
|
||||
* @param sqlProvider object which is potentially a SqlProvider
|
||||
* @param sqlProvider object which is potentially an SqlProvider
|
||||
* @return the SQL string, or {@code null} if not known
|
||||
* @see SqlProvider
|
||||
*/
|
||||
|
||||
@@ -37,7 +37,7 @@ public interface ParameterDisposer {
|
||||
/**
|
||||
* Close the resources allocated by parameters that the implementing
|
||||
* object holds, for example in case of a DisposableSqlTypeValue
|
||||
* (like a SqlLobValue).
|
||||
* (like an SqlLobValue).
|
||||
* @see DisposableSqlTypeValue#cleanup()
|
||||
* @see org.springframework.jdbc.core.support.SqlLobValue#cleanup()
|
||||
*/
|
||||
|
||||
@@ -152,7 +152,7 @@ public abstract class StatementCreatorUtils {
|
||||
* @param ps the prepared statement or callable statement
|
||||
* @param paramIndex index of the parameter we are setting
|
||||
* @param sqlType the SQL type of the parameter
|
||||
* @param inValue the value to set (plain value or a SqlTypeValue)
|
||||
* @param inValue the value to set (plain value or an SqlTypeValue)
|
||||
* @throws SQLException if thrown by PreparedStatement methods
|
||||
* @see SqlTypeValue
|
||||
*/
|
||||
@@ -170,7 +170,7 @@ public abstract class StatementCreatorUtils {
|
||||
* @param sqlType the SQL type of the parameter
|
||||
* @param typeName the type name of the parameter
|
||||
* (optional, only used for SQL NULL and SqlTypeValue)
|
||||
* @param inValue the value to set (plain value or a SqlTypeValue)
|
||||
* @param inValue the value to set (plain value or an SqlTypeValue)
|
||||
* @throws SQLException if thrown by PreparedStatement methods
|
||||
* @see SqlTypeValue
|
||||
*/
|
||||
@@ -190,7 +190,7 @@ public abstract class StatementCreatorUtils {
|
||||
* (optional, only used for SQL NULL and SqlTypeValue)
|
||||
* @param scale the number of digits after the decimal point
|
||||
* (for DECIMAL and NUMERIC types)
|
||||
* @param inValue the value to set (plain value or a SqlTypeValue)
|
||||
* @param inValue the value to set (plain value or an SqlTypeValue)
|
||||
* @throws SQLException if thrown by PreparedStatement methods
|
||||
* @see SqlTypeValue
|
||||
*/
|
||||
|
||||
@@ -391,7 +391,7 @@ public class CallMetaDataContext {
|
||||
if (param == null) {
|
||||
throw new InvalidDataAccessApiUsageException(
|
||||
"Unable to locate declared parameter for function return value - " +
|
||||
" add a SqlOutParameter with name '" + getFunctionReturnName() + "'");
|
||||
" add an SqlOutParameter with name '" + getFunctionReturnName() + "'");
|
||||
}
|
||||
else {
|
||||
this.actualFunctionReturnName = param.getName();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 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.
|
||||
@@ -31,16 +31,16 @@ import org.springframework.lang.Nullable;
|
||||
public class CallParameterMetaData {
|
||||
|
||||
@Nullable
|
||||
private String parameterName;
|
||||
private final String parameterName;
|
||||
|
||||
private int parameterType;
|
||||
private final int parameterType;
|
||||
|
||||
private int sqlType;
|
||||
private final int sqlType;
|
||||
|
||||
@Nullable
|
||||
private String typeName;
|
||||
private final String typeName;
|
||||
|
||||
private boolean nullable;
|
||||
private final boolean nullable;
|
||||
|
||||
|
||||
/**
|
||||
@@ -58,7 +58,7 @@ public class CallParameterMetaData {
|
||||
|
||||
|
||||
/**
|
||||
* Get the parameter name.
|
||||
* Return the parameter name.
|
||||
*/
|
||||
@Nullable
|
||||
public String getParameterName() {
|
||||
@@ -66,7 +66,7 @@ public class CallParameterMetaData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parameter type.
|
||||
* Return the parameter type.
|
||||
*/
|
||||
public int getParameterType() {
|
||||
return this.parameterType;
|
||||
@@ -84,14 +84,14 @@ public class CallParameterMetaData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parameter SQL type.
|
||||
* Return the parameter SQL type.
|
||||
*/
|
||||
public int getSqlType() {
|
||||
return this.sqlType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the parameter type name.
|
||||
* Return the parameter type name.
|
||||
*/
|
||||
@Nullable
|
||||
public String getTypeName() {
|
||||
@@ -99,7 +99,7 @@ public class CallParameterMetaData {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get whether the parameter is nullable.
|
||||
* Return whether the parameter is nullable.
|
||||
*/
|
||||
public boolean isNullable() {
|
||||
return this.nullable;
|
||||
|
||||
@@ -406,7 +406,7 @@ public interface NamedParameterJdbcOperations {
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a
|
||||
* list of arguments to bind to the query, expecting a SqlRowSet.
|
||||
* list of arguments to bind to the query, expecting an SqlRowSet.
|
||||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
@@ -415,7 +415,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* Sun's JDBC RowSet Implementations download (rowset.jar).
|
||||
* @param sql the SQL query to execute
|
||||
* @param paramSource container of arguments to bind to the query
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)
|
||||
@@ -426,7 +426,7 @@ public interface NamedParameterJdbcOperations {
|
||||
|
||||
/**
|
||||
* Query given SQL to create a prepared statement from SQL and a
|
||||
* list of arguments to bind to the query, expecting a SqlRowSet.
|
||||
* list of arguments to bind to the query, expecting an SqlRowSet.
|
||||
* <p>The results will be mapped to an SqlRowSet which holds the data in a
|
||||
* disconnected fashion. This wrapper will translate any SQLExceptions thrown.
|
||||
* <p>Note that, for the default implementation, JDBC RowSet support needs to
|
||||
@@ -436,7 +436,7 @@ public interface NamedParameterJdbcOperations {
|
||||
* @param sql the SQL query to execute
|
||||
* @param paramMap map of parameters to bind to the query
|
||||
* (leaving it to the PreparedStatement to guess the corresponding SQL type)
|
||||
* @return a SqlRowSet representation (possibly a wrapper around a
|
||||
* @return an SqlRowSet representation (possibly a wrapper around a
|
||||
* {@code javax.sql.rowset.CachedRowSet})
|
||||
* @throws DataAccessException if there is any problem executing the query
|
||||
* @see org.springframework.jdbc.core.JdbcTemplate#queryForRowSet(String)
|
||||
|
||||
@@ -32,8 +32,8 @@ import org.springframework.lang.Nullable;
|
||||
* {@link java.sql.ResultSet} data.
|
||||
*
|
||||
* <p>The main difference to the standard JDBC RowSet is that a {@link java.sql.SQLException}
|
||||
* is never thrown here. This allows a SqlRowSet to be used without having to deal with
|
||||
* checked exceptions. A SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
|
||||
* is never thrown here. This allows an SqlRowSet to be used without having to deal with
|
||||
* checked exceptions. An SqlRowSet will throw Spring's {@link InvalidResultSetAccessException}
|
||||
* instead (when appropriate).
|
||||
*
|
||||
* <p>Note: This interface extends the {@code java.io.Serializable} marker interface.
|
||||
|
||||
Reference in New Issue
Block a user