From 702b27e1e4d67fd8041427d779c15a8d33ef1522 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Mon, 19 Mar 2018 12:05:04 +0100 Subject: [PATCH] Polishing --- .../jdbc/core/BeanPropertyRowMapper.java | 6 +- .../core/PreparedStatementCreatorFactory.java | 2 +- .../core/ResultSetSupportingSqlParameter.java | 4 +- .../jdbc/core/SqlInOutParameter.java | 5 +- .../jdbc/core/SqlOutParameter.java | 8 +- .../jdbc/core/SqlParameter.java | 2 +- .../jdbc/core/SqlParameterValue.java | 2 +- .../jdbc/core/SqlReturnResultSet.java | 10 +- .../jdbc/core/SqlReturnUpdateCount.java | 27 ++- .../core/metadata/CallMetaDataProvider.java | 48 ++--- .../metadata/CallMetaDataProviderFactory.java | 8 +- .../metadata/DerbyTableMetaDataProvider.java | 2 +- .../metadata/GenericCallMetaDataProvider.java | 16 +- .../GenericTableMetaDataProvider.java | 28 +-- .../metadata/OracleTableMetaDataProvider.java | 18 +- .../core/metadata/TableMetaDataProvider.java | 41 ++-- .../TableMetaDataProviderFactory.java | 8 +- .../core/metadata/TableParameterMetaData.java | 4 +- .../jdbc/core/metadata/package-info.java | 3 +- .../jdbc/core/simple/AbstractJdbcCall.java | 23 +-- .../jdbc/core/simple/SimpleJdbcCall.java | 15 +- .../core/simple/SimpleJdbcCallOperations.java | 4 +- .../jdbc/core/simple/SimpleJdbcInsert.java | 13 +- .../simple/SimpleJdbcInsertOperations.java | 4 +- .../jdbc/core/simple/package-info.java | 8 +- .../support/DatabaseMetaDataCallback.java | 8 +- .../jdbc/support/JdbcAccessor.java | 2 +- .../jdbc/support/JdbcUtils.java | 16 +- .../jdbc/support/MetaDataAccessException.java | 4 +- .../SQLErrorCodeSQLExceptionTranslator.java | 16 +- .../jdbc/support/SQLErrorCodesFactory.java | 2 +- .../jdbc/support/rowset/SqlRowSet.java | 182 +++++++----------- 32 files changed, 252 insertions(+), 287 deletions(-) diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java index a82a242b66..2c66c3f33d 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/BeanPropertyRowMapper.java @@ -50,7 +50,7 @@ import org.springframework.util.StringUtils; * top-level class and it must have a default or no-arg constructor. * *

Column values are mapped based on matching the column name as obtained from result set - * metadata to public setters for the corresponding properties. The names are matched either + * meta-data to public setters for the corresponding properties. The names are matched either * directly or by transforming a name separating the parts with underscores to the same name * using "camel" case. * @@ -214,7 +214,7 @@ public class BeanPropertyRowMapper implements RowMapper { /** - * Initialize the mapping metadata for the given class. + * Initialize the mapping meta-data for the given class. * @param mappedClass the mapped class */ protected void initialize(Class mappedClass) { @@ -275,7 +275,7 @@ public class BeanPropertyRowMapper implements RowMapper { /** * Extract the values for all columns in the current row. - *

Utilizes public setters and result set metadata. + *

Utilizes public setters and result set meta-data. * @see java.sql.ResultSetMetaData */ @Override diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java index 105e4f638d..05aab898c4 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/PreparedStatementCreatorFactory.java @@ -244,7 +244,7 @@ public class PreparedStatementCreatorFactory { for (int i = 0; i < this.parameters.size(); i++) { Object in = this.parameters.get(i); SqlParameter declaredParameter; - // SqlParameterValue overrides declared parameter metadata, in particular for + // SqlParameterValue overrides declared parameter meta-data, in particular for // independence from the declared parameter position in case of named parameters. if (in instanceof SqlParameterValue) { SqlParameterValue paramValue = (SqlParameterValue) in; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java index 1a72b51020..d13f30c4b4 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/ResultSetSupportingSqlParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -135,7 +135,7 @@ public class ResultSetSupportingSqlParameter extends SqlParameter { /** - *

This implementation always returns {@code false}. + * This implementation always returns {@code false}. */ @Override public boolean isInputValueProvided() { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java index 1c25a16b85..bec02349db 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlInOutParameter.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2018 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. @@ -21,8 +21,7 @@ package org.springframework.jdbc.core; * Will return {@code true} for SqlParameter's {@link #isInputValueProvided} * test, in contrast to a standard SqlOutParameter. * - *

Output parameters - like all stored procedure parameters - - * must have names. + *

Output parameters - like all stored procedure parameters - must have names. * * @author Thomas Risberg * @author Juergen Hoeller diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlOutParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlOutParameter.java index 4029b7cf08..2026a361d7 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlOutParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlOutParameter.java @@ -19,12 +19,10 @@ package org.springframework.jdbc.core; import org.springframework.lang.Nullable; /** - * Subclass of SqlParameter to represent an output parameter. - * No additional properties: instanceof will be used to check - * for such types. + * Subclass of {@link SqlParameter} to represent an output parameter. + * No additional properties: instanceof will be used to check for such types. * - *

Output parameters - like all stored procedure parameters - - * must have names. + *

Output parameters - like all stored procedure parameters - must have names. * * @author Rod Johnson * @author Thomas Risberg diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java index cc0bc49bdd..4d8923bbfb 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameter.java @@ -172,7 +172,7 @@ public class SqlParameter { /** * Return whether this parameter is an implicit return parameter used during the - * results preocessing of the CallableStatement.getMoreResults/getUpdateCount. + * results processing of {@code CallableStatement.getMoreResults/getUpdateCount}. *

This implementation always returns {@code false}. */ public boolean isResultsParameter() { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameterValue.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameterValue.java index 0668f4c0b3..7c556c917b 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameterValue.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlParameterValue.java @@ -19,7 +19,7 @@ package org.springframework.jdbc.core; import org.springframework.lang.Nullable; /** - * Object to represent a SQL parameter value, including parameter metadata + * Object to represent a SQL parameter value, including parameter meta-data * such as the SQL type and the scale for numeric values. * *

Designed for use with {@link JdbcTemplate}'s operations that take an array of diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java index 02e956c291..6ea9cecaa7 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnResultSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2018 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. @@ -23,7 +23,7 @@ package org.springframework.jdbc.core; * must be provided to handle any returned rows. * *

Returned {@link java.sql.ResultSet ResultSets} - like all stored procedure - * parameters - must have names. + * parameters - must have names. * * @author Thomas Risberg * @author Juergen Hoeller @@ -57,13 +57,13 @@ public class SqlReturnResultSet extends ResultSetSupportingSqlParameter { super(name, 0, mapper); } + /** - * Return whether this parameter is an implicit return parameter used during the - * results preocessing of the CallableStatement.getMoreResults/getUpdateCount. - *

This implementation always returns {@code true}. + * This implementation always returns {@code true}. */ @Override public boolean isResultsParameter() { return true; } + } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java index 397ce33e6f..d78431fbd4 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/SqlReturnUpdateCount.java @@ -1,3 +1,19 @@ +/* + * Copyright 2002-2018 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. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package org.springframework.jdbc.core; import java.sql.Types; @@ -13,7 +29,7 @@ import java.sql.Types; public class SqlReturnUpdateCount extends SqlParameter { /** - * Create a new instance of the {@link SqlReturnUpdateCount} class. + * Create a new SqlReturnUpdateCount. * @param name name of the parameter, as used in input and output maps */ public SqlReturnUpdateCount(String name) { @@ -22,9 +38,7 @@ public class SqlReturnUpdateCount extends SqlParameter { /** - * Return whether this parameter holds input values that should be set - * before execution even if they are {@code null}. - *

This implementation always returns {@code false}. + * This implementation always returns {@code false}. */ @Override public boolean isInputValueProvided() { @@ -32,12 +46,11 @@ public class SqlReturnUpdateCount extends SqlParameter { } /** - * Return whether this parameter is an implicit return parameter used during the - * results preocessing of the CallableStatement.getMoreResults/getUpdateCount. - *

This implementation always returns {@code true}. + * This implementation always returns {@code true}. */ @Override public boolean isResultsParameter() { return true; } + } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProvider.java index 5359796e66..c963d1de58 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProvider.java @@ -24,7 +24,7 @@ import org.springframework.jdbc.core.SqlParameter; import org.springframework.lang.Nullable; /** - * Interface specifying the API to be implemented by a class providing call metadata. + * Interface specifying the API to be implemented by a class providing call meta-data. * *

This is intended for internal use by Spring's * {@link org.springframework.jdbc.core.simple.SimpleJdbcCall}. @@ -42,9 +42,9 @@ public interface CallMetaDataProvider { void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException; /** - * Initialize the database specific management of procedure column meta data. + * Initialize the database specific management of procedure column meta-data. * This is only called for databases that are supported. This initialization - * can be turned off by specifying that column meta data should not be used. + * can be turned off by specifying that column meta-data should not be used. * @param databaseMetaData used to retrieve database specific information * @param catalogName name of catalog to use (or {@code null} if none) * @param schemaName name of schema name to use (or {@code null} if none) @@ -56,44 +56,44 @@ public interface CallMetaDataProvider { @Nullable String schemaName, @Nullable String procedureName) throws SQLException; /** - * Provide any modification of the procedure name passed in to match the meta data currently used. + * Provide any modification of the procedure name passed in to match the meta-data currently used. * This could include altering the case. */ @Nullable String procedureNameToUse(@Nullable String procedureName); /** - * Provide any modification of the catalog name passed in to match the meta data currently used. + * Provide any modification of the catalog name passed in to match the meta-data currently used. * This could include altering the case. */ @Nullable String catalogNameToUse(@Nullable String catalogName); /** - * Provide any modification of the schema name passed in to match the meta data currently used. + * Provide any modification of the schema name passed in to match the meta-data currently used. * This could include altering the case. */ @Nullable String schemaNameToUse(@Nullable String schemaName); /** - * Provide any modification of the catalog name passed in to match the meta data currently used. - * The returned value will be used for meta data lookups. This could include altering the case + * Provide any modification of the catalog name passed in to match the meta-data currently used. + * The returned value will be used for meta-data lookups. This could include altering the case * used or providing a base catalog if none is provided. */ @Nullable String metaDataCatalogNameToUse(@Nullable String catalogName) ; /** - * Provide any modification of the schema name passed in to match the meta data currently used. - * The returned value will be used for meta data lookups. This could include altering the case + * Provide any modification of the schema name passed in to match the meta-data currently used. + * The returned value will be used for meta-data lookups. This could include altering the case * used or providing a base schema if none is provided. */ @Nullable String metaDataSchemaNameToUse(@Nullable String schemaName); /** - * Provide any modification of the column name passed in to match the meta data currently used. + * Provide any modification of the column name passed in to match the meta-data currently used. * This could include altering the case. * @param parameterName name of the parameter of column */ @@ -101,42 +101,42 @@ public interface CallMetaDataProvider { String parameterNameToUse(@Nullable String parameterName); /** - * Create a default out parameter based on the provided meta data. + * Create a default out parameter based on the provided meta-data. * This is used when no explicit parameter declaration has been made. * @param parameterName the name of the parameter - * @param meta meta data used for this call + * @param meta meta-data used for this call * @return the configured SqlOutParameter */ SqlParameter createDefaultOutParameter(String parameterName, CallParameterMetaData meta); /** - * Create a default inout parameter based on the provided meta data. + * Create a default inout parameter based on the provided meta-data. * This is used when no explicit parameter declaration has been made. * @param parameterName the name of the parameter - * @param meta meta data used for this call + * @param meta meta-data used for this call * @return the configured SqlInOutParameter */ SqlParameter createDefaultInOutParameter(String parameterName, CallParameterMetaData meta); /** - * Create a default in parameter based on the provided meta data. + * Create a default in parameter based on the provided meta-data. * This is used when no explicit parameter declaration has been made. * @param parameterName the name of the parameter - * @param meta meta data used for this call + * @param meta meta-data used for this call * @return the configured SqlParameter */ SqlParameter createDefaultInParameter(String parameterName, CallParameterMetaData meta); /** - * Get the name of the current user. Useful for meta data lookups etc. + * Get the name of the current user. Useful for meta-data lookups etc. * @return current user name from database connection */ @Nullable String getUserName(); /** - * Does this database support returning ResultSets that should be retrieved with the JDBC call. - * {@link java.sql.Statement#getResultSet()} + * Does this database support returning ResultSets that should be retrieved with the JDBC call: + * {@link java.sql.Statement#getResultSet()}? */ boolean isReturnResultSetSupported(); @@ -153,7 +153,7 @@ public interface CallMetaDataProvider { int getRefCursorSqlType(); /** - * Are we using the meta data for the procedure columns? + * Are we using the meta-data for the procedure columns? */ boolean isProcedureColumnMetaDataUsed(); @@ -165,18 +165,18 @@ public interface CallMetaDataProvider { boolean byPassReturnParameter(String parameterName); /** - * Get the call parameter metadata that is currently used. + * Get the call parameter meta-data that is currently used. * @return List of {@link CallParameterMetaData} */ List getCallParameterMetaData(); /** - * Does the database support the use of catalog name in procedure calls + * Does the database support the use of catalog name in procedure calls? */ boolean isSupportsCatalogsInProcedureCalls(); /** - * Does the database support the use of schema name in procedure calls + * Does the database support the use of schema name in procedure calls? */ boolean isSupportsSchemasInProcedureCalls(); diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java index fb7ed71830..277d31dcbc 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/CallMetaDataProviderFactory.java @@ -60,9 +60,9 @@ public class CallMetaDataProviderFactory { /** - * Create a {@link CallMetaDataProvider} based on the database metadata - * @param dataSource used to retrieve metadata - * @param context the class that holds configuration and metadata + * Create a {@link CallMetaDataProvider} based on the database meta-data + * @param dataSource used to retrieve meta-data + * @param context the class that holds configuration and meta-data * @return instance of the CallMetaDataProvider implementation to be used */ public static CallMetaDataProvider createMetaDataProvider(DataSource dataSource, final CallMetaDataContext context) { @@ -133,7 +133,7 @@ public class CallMetaDataProviderFactory { }); } catch (MetaDataAccessException ex) { - throw new DataAccessResourceFailureException("Error retrieving database metadata", ex); + throw new DataAccessResourceFailureException("Error retrieving database meta-data", ex); } } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/DerbyTableMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/DerbyTableMetaDataProvider.java index 8ea0bdfffb..b40ac99fb0 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/DerbyTableMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/DerbyTableMetaDataProvider.java @@ -21,7 +21,7 @@ import java.sql.SQLException; /** * The Derby specific implementation of {@link TableMetaDataProvider}. - * Overrides the Derby metadata info regarding retrieving generated keys. + * Overrides the Derby meta-data info regarding retrieving generated keys. * * @author Thomas Risberg * @since 3.0 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java index 6d8137019a..d65f78dfc9 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java @@ -62,8 +62,8 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { /** - * Constructor used to initialize with provided database meta data. - * @param databaseMetaData meta data to be used + * Constructor used to initialize with provided database meta-data. + * @param databaseMetaData meta-data to be used */ protected GenericCallMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException { this.userName = databaseMetaData.getUserName(); @@ -315,7 +315,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { /** - * Process the procedure column metadata + * Process the procedure column meta-data */ private void processProcedureColumns(DatabaseMetaData databaseMetaData, @Nullable String catalogName, @Nullable String schemaName, @Nullable String procedureName) { @@ -324,7 +324,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { String metaDataSchemaName = metaDataSchemaNameToUse(schemaName); String metaDataProcedureName = procedureNameToUse(procedureName); if (logger.isDebugEnabled()) { - logger.debug("Retrieving metadata for " + metaDataCatalogName + '/' + + logger.debug("Retrieving meta-data for " + metaDataCatalogName + '/' + metaDataSchemaName + '/' + metaDataProcedureName); } @@ -375,7 +375,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { columnType == DatabaseMetaData.procedureColumnInOut || columnType == DatabaseMetaData.procedureColumnOut)) { if (logger.isDebugEnabled()) { - logger.debug("Skipping metadata for: " + columnType + " " + procs.getInt("DATA_TYPE") + + logger.debug("Skipping meta-data for: " + columnType + " " + procs.getInt("DATA_TYPE") + " " + procs.getString("TYPE_NAME") + " " + procs.getInt("NULLABLE") + " (probably a member of a collection)"); } @@ -386,7 +386,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { procs.getInt("NULLABLE") == DatabaseMetaData.procedureNullable); this.callParameterMetaData.add(meta); if (logger.isDebugEnabled()) { - logger.debug("Retrieved metadata: " + meta.getParameterName() + " " + + logger.debug("Retrieved meta-data: " + meta.getParameterName() + " " + meta.getParameterType() + " " + meta.getSqlType() + " " + meta.getTypeName() + " " + meta.isNullable()); } @@ -395,7 +395,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { } catch (SQLException ex) { if (logger.isWarnEnabled()) { - logger.warn("Error while retrieving metadata for procedure columns: " + ex); + logger.warn("Error while retrieving meta-data for procedure columns: " + ex); } } finally { @@ -406,7 +406,7 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider { } catch (SQLException ex) { if (logger.isWarnEnabled()) { - logger.warn("Problem closing ResultSet for procedure column metadata: " + ex); + logger.warn("Problem closing ResultSet for procedure column meta-data: " + ex); } } } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java index 946d9b5349..c5021681cc 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java @@ -46,7 +46,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { /** Logger available to subclasses */ protected static final Log logger = LogFactory.getLog(TableMetaDataProvider.class); - /** indicator whether column metadata should be used */ + /** indicator whether column meta-data should be used */ private boolean tableColumnMetaDataUsed = false; /** the version of the database */ @@ -78,8 +78,8 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { /** - * Constructor used to initialize with provided database metadata. - * @param databaseMetaData metadata to be used + * Constructor used to initialize with provided database meta-data. + * @param databaseMetaData meta-data to be used */ protected GenericTableMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException { this.userName = databaseMetaData.getUserName(); @@ -305,7 +305,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { } /** - * Method supporting the metadata processing for a table. + * Method supporting the meta-data processing for a table. */ private void locateTableAndProcessMetaData(DatabaseMetaData databaseMetaData, @Nullable String catalogName, @Nullable String schemaName, @Nullable String tableName) { @@ -330,7 +330,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { } catch (SQLException ex) { if (logger.isWarnEnabled()) { - logger.warn("Error while accessing table meta data results: " + ex.getMessage()); + logger.warn("Error while accessing table meta-data results: " + ex.getMessage()); } } finally { @@ -339,7 +339,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { if (tableMeta.isEmpty()) { if (logger.isWarnEnabled()) { - logger.warn("Unable to locate table meta data for '" + tableName + "': column names must be provided"); + logger.warn("Unable to locate table meta-data for '" + tableName + "': column names must be provided"); } } else { @@ -353,7 +353,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { if (schemaName != null) { TableMetaData tmd = tableMeta.get(schemaName.toUpperCase()); if (tmd == null) { - throw new DataAccessResourceFailureException("Unable to locate table meta data for '" + + throw new DataAccessResourceFailureException("Unable to locate table meta-data for '" + tableName + "' in the '" + schemaName + "' schema"); } return tmd; @@ -374,14 +374,14 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { } if (tmd == null) { throw new DataAccessResourceFailureException( - "Unable to locate table meta data for '" + tableName + "' in the default schema"); + "Unable to locate table meta-data for '" + tableName + "' in the default schema"); } return tmd; } } /** - * Method supporting the metadata processing for a table's columns + * Method supporting the meta-data processing for a table's columns */ private void processTableColumns(DatabaseMetaData databaseMetaData, TableMetaData tmd) { ResultSet tableColumns = null; @@ -389,7 +389,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { String metaDataSchemaName = metaDataSchemaNameToUse(tmd.getSchemaName()); String metaDataTableName = tableNameToUse(tmd.getTableName()); if (logger.isDebugEnabled()) { - logger.debug("Retrieving metadata for " + metaDataCatalogName + '/' + + logger.debug("Retrieving meta-data for " + metaDataCatalogName + '/' + metaDataSchemaName + '/' + metaDataTableName); } try { @@ -407,7 +407,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { if ("NUMBER".equals(typeName) && decimalDigits == 0) { dataType = Types.NUMERIC; if (logger.isDebugEnabled()) { - logger.debug("Overriding metadata: " + columnName + " now NUMERIC instead of DECIMAL"); + logger.debug("Overriding meta-data: " + columnName + " now NUMERIC instead of DECIMAL"); } } } @@ -415,14 +415,14 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { TableParameterMetaData meta = new TableParameterMetaData(columnName, dataType, nullable); this.tableParameterMetaData.add(meta); if (logger.isDebugEnabled()) { - logger.debug("Retrieved metadata: " + meta.getParameterName() + " " + + logger.debug("Retrieved meta-data: " + meta.getParameterName() + " " + meta.getSqlType() + " " + meta.isNullable()); } } } catch (SQLException ex) { if (logger.isWarnEnabled()) { - logger.warn("Error while retrieving metadata for table columns: " + ex.getMessage()); + logger.warn("Error while retrieving meta-data for table columns: " + ex.getMessage()); } } finally { @@ -432,7 +432,7 @@ public class GenericTableMetaDataProvider implements TableMetaDataProvider { /** - * Inner class representing table meta data. + * Inner class representing table meta-data. */ private static class TableMetaData { diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java index 5d73b87a9b..6987780b4d 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/OracleTableMetaDataProvider.java @@ -29,7 +29,7 @@ import org.springframework.util.ReflectionUtils; /** * Oracle-specific implementation of the {@link org.springframework.jdbc.core.metadata.TableMetaDataProvider}. - * Supports a feature for including synonyms in the metadata lookup. Also supports lookup of current schema + * Supports a feature for including synonyms in the meta-data lookup. Also supports lookup of current schema * using the {@code sys_context}. * *

Thanks to Mike Youngstrom and Bruce Campbell for submitting the original suggestion for the Oracle @@ -48,16 +48,16 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider { /** - * Constructor used to initialize with provided database metadata. - * @param databaseMetaData metadata to be used + * Constructor used to initialize with provided database meta-data. + * @param databaseMetaData meta-data to be used */ public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData) throws SQLException { this(databaseMetaData, false); } /** - * Constructor used to initialize with provided database metadata. - * @param databaseMetaData metadata to be used + * Constructor used to initialize with provided database meta-data. + * @param databaseMetaData meta-data to be used * @param includeSynonyms whether to include synonyms */ public OracleTableMetaDataProvider(DatabaseMetaData databaseMetaData, boolean includeSynonyms) @@ -115,14 +115,14 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider { throws SQLException { if (!this.includeSynonyms) { - logger.debug("Defaulting to no synonyms in table metadata lookup"); + logger.debug("Defaulting to no synonyms in table meta-data lookup"); super.initializeWithTableColumnMetaData(databaseMetaData, catalogName, schemaName, tableName); return; } Connection con = databaseMetaData.getConnection(); if (con == null) { - logger.warn("Unable to include synonyms in table metadata lookup - no Connection from DatabaseMetaData"); + logger.warn("Unable to include synonyms in table meta-data lookup - no Connection from DatabaseMetaData"); super.initializeWithTableColumnMetaData(databaseMetaData, catalogName, schemaName, tableName); return; } @@ -133,13 +133,13 @@ public class OracleTableMetaDataProvider extends GenericTableMetaDataProvider { } catch (ClassNotFoundException | SQLException ex) { if (logger.isWarnEnabled()) { - logger.warn("Unable to include synonyms in table metadata lookup - no Oracle Connection: " + ex); + logger.warn("Unable to include synonyms in table meta-data lookup - no Oracle Connection: " + ex); } super.initializeWithTableColumnMetaData(databaseMetaData, catalogName, schemaName, tableName); return; } - logger.debug("Including synonyms in table metadata lookup"); + logger.debug("Including synonyms in table meta-data lookup"); Method setIncludeSynonyms; Boolean originalValueForIncludeSynonyms; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProvider.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProvider.java index 941c430f55..fd7a8467b0 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProvider.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProvider.java @@ -23,7 +23,7 @@ import java.util.List; import org.springframework.lang.Nullable; /** - * Interface specifying the API to be implemented by a class providing table metadata. + * Interface specifying the API to be implemented by a class providing table meta-data. * This is intended for internal use by the Simple JDBC classes. * * @author Thomas Risberg @@ -32,15 +32,15 @@ import org.springframework.lang.Nullable; public interface TableMetaDataProvider { /** - * Initialize using the database metadata provided. + * Initialize using the database meta-data provided. * @param databaseMetaData used to retrieve database specific information * @throws SQLException in case of initialization failure */ void initializeWithMetaData(DatabaseMetaData databaseMetaData) throws SQLException; /** - * Initialize using provided database metadata, table and column information. - * This initialization can be turned off by specifying that column meta data should not be used. + * Initialize using provided database meta-data, table and column information. + * This initialization can be turned off by specifying that column meta-data should not be used. * @param databaseMetaData used to retrieve database specific information * @param catalogName name of catalog to use (or {@code null} if none) * @param schemaName name of schema name to use (or {@code null} if none) @@ -51,46 +51,49 @@ public interface TableMetaDataProvider { @Nullable String schemaName, @Nullable String tableName) throws SQLException; /** - * Get the table name formatted based on metadata information. This could include altering the case. + * Get the table name formatted based on meta-data information. + * This could include altering the case. */ @Nullable String tableNameToUse(@Nullable String tableName); /** - * Get the catalog name formatted based on metadata information. This could include altering the case. + * Get the catalog name formatted based on meta-data information. + * This could include altering the case. */ @Nullable String catalogNameToUse(@Nullable String catalogName); /** - * Get the schema name formatted based on metadata information. This could include altering the case. + * Get the schema name formatted based on meta-data information. + * This could include altering the case. */ @Nullable String schemaNameToUse(@Nullable String schemaName); /** - * Provide any modification of the catalog name passed in to match the meta data currently used. - * The returned value will be used for meta data lookups. This could include altering the case used or - * providing a base catalog if none is provided. + * Provide any modification of the catalog name passed in to match the meta-data currently used. + * The returned value will be used for meta-data lookups. + * This could include altering the case used or providing a base catalog if none is provided. */ @Nullable String metaDataCatalogNameToUse(@Nullable String catalogName) ; /** - * Provide any modification of the schema name passed in to match the meta data currently used. - * The returned value will be used for meta data lookups. This could include altering the case used or - * providing a base schema if none is provided. + * Provide any modification of the schema name passed in to match the meta-data currently used. + * The returned value will be used for meta-data lookups. + * This could include altering the case used or providing a base schema if none is provided. */ @Nullable String metaDataSchemaNameToUse(@Nullable String schemaName) ; /** - * Are we using the meta data for the table columns? + * Are we using the meta-data for the table columns? */ boolean isTableColumnMetaDataUsed(); /** - * Does this database support the JDBC 3.0 feature of retrieving generated keys + * Does this database support the JDBC 3.0 feature of retrieving generated keys: * {@link java.sql.DatabaseMetaData#supportsGetGeneratedKeys()}? */ boolean isGetGeneratedKeysSupported(); @@ -103,19 +106,19 @@ public interface TableMetaDataProvider { boolean isGetGeneratedKeysSimulated(); /** - * Get the simple query to retrieve a generated key + * Get the simple query to retrieve a generated key. */ @Nullable String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName); /** - * Does this database support a column name String array for retrieving generated keys - * {@link java.sql.Connection#createStruct(String, Object[])} + * Does this database support a column name String array for retrieving generated keys: + * {@link java.sql.Connection#createStruct(String, Object[])}? */ boolean isGeneratedKeysColumnNameArraySupported(); /** - * Get the table parameter metadata that is currently used. + * Get the table parameter meta-data that is currently used. * @return List of {@link TableParameterMetaData} */ List getTableParameterMetaData(); diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java index cce85349e1..22670788d3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableMetaDataProviderFactory.java @@ -38,9 +38,9 @@ public class TableMetaDataProviderFactory { /** - * Create a {@link TableMetaDataProvider} based on the database metadata. - * @param dataSource used to retrieve metadata - * @param context the class that holds configuration and metadata + * Create a {@link TableMetaDataProvider} based on the database meta-data. + * @param dataSource used to retrieve meta-data + * @param context the class that holds configuration and meta-data * @return instance of the TableMetaDataProvider implementation to be used */ public static TableMetaDataProvider createMetaDataProvider(DataSource dataSource, TableMetaDataContext context) { @@ -80,7 +80,7 @@ public class TableMetaDataProviderFactory { }); } catch (MetaDataAccessException ex) { - throw new DataAccessResourceFailureException("Error retrieving database metadata", ex); + throw new DataAccessResourceFailureException("Error retrieving database meta-data", ex); } } diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableParameterMetaData.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableParameterMetaData.java index f63f29f470..7f6081dddf 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableParameterMetaData.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/TableParameterMetaData.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -17,7 +17,7 @@ package org.springframework.jdbc.core.metadata; /** - * Holder of metadata for a specific parameter that is used for table processing. + * Holder of meta-data for a specific parameter that is used for table processing. * * @author Thomas Risberg * @since 2.5 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/package-info.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/package-info.java index 2af03f0ddf..3627e646b3 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/package-info.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/package-info.java @@ -1,5 +1,6 @@ /** - * Context metadata abstraction for the configuration and execution of a stored procedure call. + * Context metadata abstraction for the configuration and execution + * of table inserts and stored procedure calls. */ @NonNullApi @NonNullFields diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java index d070f28e24..406cf1e526 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/AbstractJdbcCall.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2017 the original author or authors. + * Copyright 2002-2018 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. @@ -40,8 +40,9 @@ import org.springframework.util.StringUtils; /** * Abstract class to provide base functionality for easy stored procedure calls - * based on configuration options and database metadata. - * This class provides the base SPI for {@link SimpleJdbcCall}. + * based on configuration options and database meta-data. + * + *

This class provides the base SPI for {@link SimpleJdbcCall}. * * @author Thomas Risberg * @author Juergen Hoeller @@ -55,7 +56,7 @@ public abstract class AbstractJdbcCall { /** Lower-level class used to execute SQL */ private final JdbcTemplate jdbcTemplate; - /** Context used to retrieve and manage database metadata */ + /** Context used to retrieve and manage database meta-data */ private final CallMetaDataContext callMetaDataContext = new CallMetaDataContext(); /** List of SqlParameter objects */ @@ -214,7 +215,7 @@ public abstract class AbstractJdbcCall { } /** - * Specify whether the parameter metadata for the call should be used. + * Specify whether the parameter meta-data for the call should be used. * The default is {@code true}. */ public void setAccessCallParameterMetaData(boolean accessCallParameterMetaData) { @@ -222,7 +223,7 @@ public abstract class AbstractJdbcCall { } /** - * Get the call string that should be used based on parameters and meta data. + * Get the call string that should be used based on parameters and meta-data. */ @Nullable public String getCallString() { @@ -276,7 +277,7 @@ public abstract class AbstractJdbcCall { //------------------------------------------------------------------------- /** - * Compile this JdbcCall using provided parameters and meta data plus other settings. + * Compile this JdbcCall using provided parameters and meta-data plus other settings. *

This finalizes the configuration for this object and subsequent attempts to compile are * ignored. This will be implicitly called the first time an un-compiled call is executed. * @throws org.springframework.dao.InvalidDataAccessApiUsageException if the object hasn't @@ -426,7 +427,7 @@ public abstract class AbstractJdbcCall { /** * Get a List of all the call parameters to be used for call. - * This includes any parameters added based on meta data processing. + * This includes any parameters added based on meta-data processing. */ protected List getCallParameters() { return this.callMetaDataContext.getCallParameters(); @@ -434,7 +435,7 @@ public abstract class AbstractJdbcCall { /** * Match the provided in parameter values with registered parameters and - * parameters defined via metadata processing. + * parameters defined via meta-data processing. * @param parameterSource the parameter vakues provided as a {@link SqlParameterSource} * @return Map with parameter names and values */ @@ -444,7 +445,7 @@ public abstract class AbstractJdbcCall { /** * Match the provided in parameter values with registered parameters and - * parameters defined via metadata processing. + * parameters defined via meta-data processing. * @param args the parameter values provided as an array * @return Map with parameter names and values */ @@ -454,7 +455,7 @@ public abstract class AbstractJdbcCall { /** * Match the provided in parameter values with registered parameters and - * parameters defined via metadata processing. + * parameters defined via meta-data processing. * @param args the parameter values provided in a Map * @return Map with parameter names and values */ diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java index 0786308e21..1cce413055 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCall.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2016 the original author or authors. + * Copyright 2002-2018 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. @@ -28,26 +28,25 @@ import org.springframework.jdbc.core.namedparam.SqlParameterSource; /** * A SimpleJdbcCall is a multi-threaded, reusable object representing a call - * to a stored procedure or a stored function. It provides meta data processing + * to a stored procedure or a stored function. It provides meta-data processing * to simplify the code needed to access basic stored procedures/functions. * All you need to provide is the name of the procedure/function and a Map * containing the parameters when you execute the call. The names of the * supplied parameters will be matched up with in and out parameters declared * when the stored procedure was created. * - *

The meta data processing is based on the DatabaseMetaData provided by + *

The meta-data processing is based on the DatabaseMetaData provided by * the JDBC driver. Since we rely on the JDBC driver, this "auto-detection" - * can only be used for databases that are known to provide accurate meta data. + * can only be used for databases that are known to provide accurate meta-data. * These currently include Derby, MySQL, Microsoft SQL Server, Oracle, DB2, * Sybase and PostgreSQL. For any other databases you are required to declare * all parameters explicitly. You can of course declare all parameters - * explicitly even if the database provides the necessary meta data. In that + * explicitly even if the database provides the necessary meta-data. In that * case your declared parameters will take precedence. You can also turn off - * any metadata processing if you want to use parameter names that do not + * any meta-data processing if you want to use parameter names that do not * match what is declared during the stored procedure compilation. * - *

The actual insert is being handled using Spring's - * {@link org.springframework.jdbc.core.JdbcTemplate}. + *

The actual insert is being handled using Spring's {@link JdbcTemplate}. * *

Many of the configuration methods return the current instance of the * SimpleJdbcCall in order to provide the ability to chain multiple ones diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCallOperations.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCallOperations.java index 6cb91185c7..4067c86e06 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCallOperations.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcCallOperations.java @@ -71,7 +71,7 @@ public interface SimpleJdbcCallOperations { /** * Specify one or more parameters if desired. These parameters will be supplemented with - * any parameter information retrieved from the database meta data. + * any parameter information retrieved from the database meta-data. *

Note that only parameters declared as {@code SqlParameter} and {@code SqlInOutParameter} * will be used to provide input values. This is different from the {@code StoredProcedure} * class which - for backwards compatibility reasons - allows input values to be provided @@ -96,7 +96,7 @@ public interface SimpleJdbcCallOperations { SimpleJdbcCallOperations returningResultSet(String parameterName, RowMapper rowMapper); /** - * Turn off any processing of parameter meta data information obtained via JDBC. + * Turn off any processing of parameter meta-data information obtained via JDBC. * @return the instance of this SimpleJdbcCall */ SimpleJdbcCallOperations withoutProcedureColumnMetaDataAccess(); diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsert.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsert.java index d670e448e9..ab2f159f00 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsert.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsert.java @@ -26,22 +26,23 @@ import org.springframework.jdbc.support.KeyHolder; /** * A SimpleJdbcInsert is a multi-threaded, reusable object providing easy insert - * capabilities for a table. It provides meta data processing to simplify the code + * capabilities for a table. It provides meta-data processing to simplify the code * needed to construct a basic insert statement. All you need to provide is the * name of the table and a Map containing the column names and the column values. * - *

The meta data processing is based on the DatabaseMetaData provided by the + *

The meta-data processing is based on the DatabaseMetaData provided by the * JDBC driver. As long as the JDBC driver can provide the names of the columns * for a specified table than we can rely on this auto-detection feature. If that * is not the case, then the column names must be specified explicitly. * - *

The actual insert is being handled using Spring's - * {@link org.springframework.jdbc.core.JdbcTemplate}. + *

The actual insert is being handled using Spring's {@link JdbcTemplate}. * - *

Many of the configuration methods return the current instance of the SimpleJdbcInsert - * to provide the ability to chain multiple ones together in a "fluent" interface style. + *

Many of the configuration methods return the current instance of the + * SimpleJdbcInsert to provide the ability to chain multiple ones together + * in a "fluent" interface style. * * @author Thomas Risberg + * @author Juergen Hoeller * @since 2.5 * @see java.sql.DatabaseMetaData * @see org.springframework.jdbc.core.JdbcTemplate diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java index b260dc825b..46a4e36340 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/SimpleJdbcInsertOperations.java @@ -67,13 +67,13 @@ public interface SimpleJdbcInsertOperations { SimpleJdbcInsertOperations usingGeneratedKeyColumns(String... columnNames); /** - * Turn off any processing of column meta data information obtained via JDBC. + * Turn off any processing of column meta-data information obtained via JDBC. * @return the instance of this SimpleJdbcInsert */ SimpleJdbcInsertOperations withoutTableColumnMetaDataAccess(); /** - * Include synonyms for the column meta data lookups via JDBC. + * Include synonyms for the column meta-data lookups via JDBC. *

Note: This is only necessary to include for Oracle since other databases * supporting synonyms seems to include the synonyms automatically. * @return the instance of this SimpleJdbcInsert diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/package-info.java b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/package-info.java index f5723ffdf8..cc76422271 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/package-info.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/core/simple/package-info.java @@ -1,9 +1,9 @@ /** - * Simplification layer over JdbcTemplate for Java 5 and above. + * Simplification layer for table inserts and stored procedure calls. * - *

{@code SimpleJdbcInsert} and {@code SimpleJdbcCall} are classes that takes advantage - * of database metadata provided by the JDBC driver to simplify the application code. Much of the - * parameter specification becomes unnecessary since it can be looked up in the metadata. + *

{@code SimpleJdbcInsert} and {@code SimpleJdbcCall} take advantage of database + * meta-data provided by the JDBC driver to simplify the application code. Much of the + * parameter specification becomes unnecessary since it can be looked up in the meta-data. */ @NonNullApi @NonNullFields diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseMetaDataCallback.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseMetaDataCallback.java index 8b283c2633..37617e03dd 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseMetaDataCallback.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/DatabaseMetaDataCallback.java @@ -21,7 +21,7 @@ import java.sql.SQLException; /** * A callback interface used by the JdbcUtils class. Implementations of this - * interface perform the actual work of extracting database meta data, but + * interface perform the actual work of extracting database meta-data, but * don't need to worry about exception handling. SQLExceptions will be caught * and handled correctly by the JdbcUtils class. * @@ -32,15 +32,15 @@ import java.sql.SQLException; public interface DatabaseMetaDataCallback { /** - * Implementations must implement this method to process the meta data + * Implementations must implement this method to process the meta-data * passed in. Exactly what the implementation chooses to do is up to it. * @param dbmd the DatabaseMetaData to process - * @return a result object extracted from the meta data + * @return a result object extracted from the meta-data * (can be an arbitrary object, as needed by the implementation) * @throws SQLException if a SQLException is encountered getting * column values (that is, there's no need to catch SQLException) * @throws MetaDataAccessException in case of other failures while - * extracting meta data (for example, reflection failure) + * extracting meta-data (for example, reflection failure) */ Object processMetaData(DatabaseMetaData dbmd) throws SQLException, MetaDataAccessException; diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcAccessor.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcAccessor.java index 17350cfbf3..20b4919ceb 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcAccessor.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/JdbcAccessor.java @@ -81,7 +81,7 @@ public abstract class JdbcAccessor implements InitializingBean { /** * Specify the database product name for the DataSource that this accessor uses. * This allows to initialize a SQLErrorCodeSQLExceptionTranslator without - * obtaining a Connection from the DataSource to get the metadata. + * obtaining a Connection from the DataSource to get the meta-data. * @param dbName the database product name that identifies the error codes entry * @see SQLErrorCodeSQLExceptionTranslator#setDatabaseProductName * @see java.sql.DatabaseMetaData#getDatabaseProductName() 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 8470126f43..d2766dd70b 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 @@ -296,19 +296,19 @@ public abstract class JdbcUtils { } /** - * Extract database meta data via the given DatabaseMetaDataCallback. - *

This method will open a connection to the database and retrieve the database metadata. + * Extract database meta-data via the given DatabaseMetaDataCallback. + *

This method will open a connection to the database and retrieve the database meta-data. * Since this method is called before the exception translation feature is configured for * a datasource, this method can not rely on the SQLException translation functionality. *

Any exceptions will be wrapped in a MetaDataAccessException. This is a checked exception * and any calling code should catch and handle this exception. You can just log the * error and hope for the best, but there is probably a more serious error that will * reappear when you try to access the database again. - * @param dataSource the DataSource to extract metadata for + * @param dataSource the DataSource to extract meta-data for * @param action callback that will do the actual work * @return object containing the extracted information, as returned by * the DatabaseMetaDataCallback's {@code processMetaData} method - * @throws MetaDataAccessException if meta data access failed + * @throws MetaDataAccessException if meta-data access failed */ public static Object extractDatabaseMetaData(DataSource dataSource, DatabaseMetaDataCallback action) throws MetaDataAccessException { @@ -324,7 +324,7 @@ public abstract class JdbcUtils { return action.processMetaData(metaData); } catch (CannotGetJdbcConnectionException ex) { - throw new MetaDataAccessException("Could not get Connection for extracting meta data", ex); + throw new MetaDataAccessException("Could not get Connection for extracting meta-data", ex); } catch (SQLException ex) { throw new MetaDataAccessException("Error while extracting DatabaseMetaData", ex); @@ -341,7 +341,7 @@ public abstract class JdbcUtils { /** * Call the specified method on DatabaseMetaData for the given DataSource, * and extract the invocation result. - * @param dataSource the DataSource to extract meta data for + * @param dataSource the DataSource to extract meta-data for * @param metaDataMethodName the name of the DatabaseMetaData method to call * @return the object returned by the specified DatabaseMetaData method * @throws MetaDataAccessException if we couldn't access the DatabaseMetaData @@ -408,7 +408,7 @@ public abstract class JdbcUtils { /** * Extract a common name for the target database in use even if * various drivers/platforms provide varying names at runtime. - * @param source the name as provided in database metadata + * @param source the name as provided in database meta-data * @return the common name to be used (e.g. "DB2" or "Sybase") */ @Nullable @@ -446,7 +446,7 @@ public abstract class JdbcUtils { *

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. * @return the column name to use - * @param resultSetMetaData the current meta data to use + * @param resultSetMetaData the current meta-data to use * @param columnIndex the index of the column for the look up * @throws SQLException in case of lookup failure */ diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/MetaDataAccessException.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/MetaDataAccessException.java index 45d9d57f1c..9923a7580f 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/MetaDataAccessException.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/MetaDataAccessException.java @@ -19,11 +19,11 @@ package org.springframework.jdbc.support; import org.springframework.core.NestedCheckedException; /** - * Exception indicating that something went wrong during JDBC metadata lookup. + * Exception indicating that something went wrong during JDBC meta-data lookup. * *

This is a checked exception since we want it to be caught, logged and * handled rather than cause the application to fail. Failure to read JDBC - * metadata is usually not a fatal problem. + * meta-data is usually not a fatal problem. * * @author Thomas Risberg * @since 1.0.1 diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java index 3cbdef779e..ca797cef5f 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLErrorCodeSQLExceptionTranslator.java @@ -45,7 +45,7 @@ import org.springframework.lang.Nullable; * concrete and is typically used itself, in which case this rule doesn't apply. *

  • Apply error code matching. Error codes are obtained from the SQLErrorCodesFactory * by default. This factory loads a "sql-error-codes.xml" file from the class path, - * defining error code mappings for database names from database metadata. + * defining error code mappings for database names from database meta-data. *
  • Fallback to a fallback translator. {@link SQLStateSQLExceptionTranslator} is the * default fallback translator, analyzing the exception's SQL state only. On Java 6 * which introduces its own {@code SQLException} subclass hierarchy, we will @@ -89,8 +89,8 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep /** * Create a SQL error code translator for the given DataSource. * Invoking this constructor will cause a Connection to be obtained - * from the DataSource to get the metadata. - * @param dataSource DataSource to use to find metadata and establish + * from the DataSource to get the meta-data. + * @param dataSource DataSource to use to find meta-data and establish * which error codes are usable * @see SQLErrorCodesFactory */ @@ -102,7 +102,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep /** * Create a SQL error code translator for the given database product name. * Invoking this constructor will avoid obtaining a Connection from the - * DataSource to get the metadata. + * DataSource to get the meta-data. * @param dbName the database product name that identifies the error codes entry * @see SQLErrorCodesFactory * @see java.sql.DatabaseMetaData#getDatabaseProductName() @@ -114,7 +114,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep /** * Create a SQLErrorCode translator given these error codes. - * Does not require a database metadata lookup to be performed using a connection. + * Does not require a database meta-data lookup to be performed using a connection. * @param sec error codes */ public SQLErrorCodeSQLExceptionTranslator(SQLErrorCodes sec) { @@ -126,8 +126,8 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep /** * Set the DataSource for this translator. *

    Setting this property will cause a Connection to be obtained from - * the DataSource to get the metadata. - * @param dataSource DataSource to use to find metadata and establish + * the DataSource to get the meta-data. + * @param dataSource DataSource to use to find meta-data and establish * which error codes are usable * @see SQLErrorCodesFactory#getErrorCodes(javax.sql.DataSource) * @see java.sql.DatabaseMetaData#getDatabaseProductName() @@ -139,7 +139,7 @@ public class SQLErrorCodeSQLExceptionTranslator extends AbstractFallbackSQLExcep /** * Set the database product name for this translator. *

    Setting this property will avoid obtaining a Connection from the DataSource - * to get the metadata. + * to get the meta-data. * @param dbName the database product name that identifies the error codes entry * @see SQLErrorCodesFactory#getErrorCodes(String) * @see java.sql.DatabaseMetaData#getDatabaseProductName() 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 f175a28720..00351f72b3 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 @@ -155,7 +155,7 @@ public class SQLErrorCodesFactory { /** * Return the {@link SQLErrorCodes} instance for the given database. - *

    No need for a database metadata lookup. + *

    No need for a database meta-data lookup. * @param databaseName the database name (must not be {@code null}) * @return the {@code SQLErrorCodes} instance for the given database * @throws IllegalArgumentException if the supplied database name is {@code null} diff --git a/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java b/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java index ac434886b5..83226f9f54 100644 --- a/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java +++ b/spring-jdbc/src/main/java/org/springframework/jdbc/support/rowset/SqlRowSet.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2014 the original author or authors. + * Copyright 2002-2018 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. @@ -27,18 +27,17 @@ import java.util.Map; import org.springframework.jdbc.InvalidResultSetAccessException; /** - * Mirror interface for {@link javax.sql.RowSet}, representing - * disconnected {@link java.sql.ResultSet} data. + * Mirror interface for {@link javax.sql.RowSet}, representing a disconnected variant of + * {@link java.sql.ResultSet} data. * - *

    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} + *

    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} * instead (when appropriate). * - *

    Note: This interface extends the {@code java.io.Serializable} marker - * interface. Implementations, which typically hold disconnected data, - * are encouraged to be actually serializable (as far as possible). + *

    Note: This interface extends the {@code java.io.Serializable} marker interface. + * Implementations, which typically hold disconnected data, are encouraged to be actually + * serializable (as far as possible). * * @author Thomas Risberg * @author Juergen Hoeller @@ -51,7 +50,7 @@ import org.springframework.jdbc.InvalidResultSetAccessException; public interface SqlRowSet extends Serializable { /** - * Retrieve the meta data, i.e. number, types and properties + * Retrieve the meta-data, i.e. number, types and properties * for the columns of this row set. * @return a corresponding SqlRowSetMetaData instance * @see java.sql.ResultSet#getMetaData() @@ -70,8 +69,7 @@ public interface SqlRowSet extends Serializable { // RowSet methods for extracting data values /** - * Retrieve the value of the indicated column in the current row - * as a BigDecimal object. + * Retrieve the value of the indicated column in the current row as a BigDecimal object. * @param columnIndex the column index * @return an BigDecimal object representing the column value * @see java.sql.ResultSet#getBigDecimal(int) @@ -79,8 +77,7 @@ public interface SqlRowSet extends Serializable { BigDecimal getBigDecimal(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a BigDecimal object. + * Retrieve the value of the indicated column in the current row as a BigDecimal object. * @param columnLabel the column label * @return an BigDecimal object representing the column value * @see java.sql.ResultSet#getBigDecimal(String) @@ -88,8 +85,7 @@ public interface SqlRowSet extends Serializable { BigDecimal getBigDecimal(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a boolean. + * Retrieve the value of the indicated column in the current row as a boolean. * @param columnIndex the column index * @return a boolean representing the column value * @see java.sql.ResultSet#getBoolean(int) @@ -97,8 +93,7 @@ public interface SqlRowSet extends Serializable { boolean getBoolean(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a boolean. + * Retrieve the value of the indicated column in the current row as a boolean. * @param columnLabel the column label * @return a boolean representing the column value * @see java.sql.ResultSet#getBoolean(String) @@ -106,8 +101,7 @@ public interface SqlRowSet extends Serializable { boolean getBoolean(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a byte. + * Retrieve the value of the indicated column in the current row as a byte. * @param columnIndex the column index * @return a byte representing the column value * @see java.sql.ResultSet#getByte(int) @@ -115,8 +109,7 @@ public interface SqlRowSet extends Serializable { byte getByte(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a byte. + * Retrieve the value of the indicated column in the current row as a byte. * @param columnLabel the column label * @return a byte representing the column value * @see java.sql.ResultSet#getByte(String) @@ -124,8 +117,7 @@ public interface SqlRowSet extends Serializable { byte getByte(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Date object. + * Retrieve the value of the indicated column in the current row as a Date object. * @param columnIndex the column index * @return a Date object representing the column value * @see java.sql.ResultSet#getDate(int) @@ -133,8 +125,7 @@ public interface SqlRowSet extends Serializable { Date getDate(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Date object. + * Retrieve the value of the indicated column in the current row as a Date object. * @param columnLabel the column label * @return a Date object representing the column value * @see java.sql.ResultSet#getDate(String) @@ -142,8 +133,7 @@ public interface SqlRowSet extends Serializable { Date getDate(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Date object. + * Retrieve the value of the indicated column in the current row as a Date object. * @param columnIndex the column index * @param cal the Calendar to use in constructing the Date * @return a Date object representing the column value @@ -152,8 +142,7 @@ public interface SqlRowSet extends Serializable { Date getDate(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Date object. + * Retrieve the value of the indicated column in the current row as a Date object. * @param columnLabel the column label * @param cal the Calendar to use in constructing the Date * @return a Date object representing the column value @@ -162,8 +151,7 @@ public interface SqlRowSet extends Serializable { Date getDate(String columnLabel, Calendar cal) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Double object. + * Retrieve the value of the indicated column in the current row as a Double object. * @param columnIndex the column index * @return a Double object representing the column value * @see java.sql.ResultSet#getDouble(int) @@ -171,8 +159,7 @@ public interface SqlRowSet extends Serializable { double getDouble(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Double object. + * Retrieve the value of the indicated column in the current row as a Double object. * @param columnLabel the column label * @return a Double object representing the column value * @see java.sql.ResultSet#getDouble(String) @@ -180,8 +167,7 @@ public interface SqlRowSet extends Serializable { double getDouble(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a float. + * Retrieve the value of the indicated column in the current row as a float. * @param columnIndex the column index * @return a float representing the column value * @see java.sql.ResultSet#getFloat(int) @@ -189,8 +175,7 @@ public interface SqlRowSet extends Serializable { float getFloat(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a float. + * Retrieve the value of the indicated column in the current row as a float. * @param columnLabel the column label * @return a float representing the column value * @see java.sql.ResultSet#getFloat(String) @@ -198,8 +183,7 @@ public interface SqlRowSet extends Serializable { float getFloat(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an int. + * Retrieve the value of the indicated column in the current row as an int. * @param columnIndex the column index * @return an int representing the column value * @see java.sql.ResultSet#getInt(int) @@ -207,8 +191,7 @@ public interface SqlRowSet extends Serializable { int getInt(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an int. + * Retrieve the value of the indicated column in the current row as an int. * @param columnLabel the column label * @return an int representing the column value * @see java.sql.ResultSet#getInt(String) @@ -216,8 +199,7 @@ public interface SqlRowSet extends Serializable { int getInt(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a long. + * Retrieve the value of the indicated column in the current row as a long. * @param columnIndex the column index * @return a long representing the column value * @see java.sql.ResultSet#getLong(int) @@ -225,8 +207,7 @@ public interface SqlRowSet extends Serializable { long getLong(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a long. + * Retrieve the value of the indicated column in the current row as a long. * @param columnLabel the column label * @return a long representing the column value * @see java.sql.ResultSet#getLong(String) @@ -234,8 +215,8 @@ public interface SqlRowSet extends Serializable { long getLong(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns). + * Retrieve the value of the indicated column in the current row as a String + * (for NCHAR, NVARCHAR, LONGNVARCHAR columns). * @param columnIndex the column index * @return a String representing the column value * @see java.sql.ResultSet#getNString(int) @@ -244,8 +225,8 @@ public interface SqlRowSet extends Serializable { String getNString(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a String (for NCHAR, NVARCHAR, LONGNVARCHAR columns). + * Retrieve the value of the indicated column in the current row as a String + * (for NCHAR, NVARCHAR, LONGNVARCHAR columns). * @param columnLabel the column label * @return a String representing the column value * @see java.sql.ResultSet#getNString(String) @@ -254,8 +235,7 @@ public interface SqlRowSet extends Serializable { String getNString(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnIndex the column index * @return a Object representing the column value * @see java.sql.ResultSet#getObject(int) @@ -263,8 +243,7 @@ public interface SqlRowSet extends Serializable { Object getObject(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnLabel the column label * @return a Object representing the column value * @see java.sql.ResultSet#getObject(String) @@ -272,8 +251,7 @@ public interface SqlRowSet extends Serializable { Object getObject(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnIndex the column index * @param map a Map object containing the mapping from SQL types to Java types * @return a Object representing the column value @@ -282,8 +260,7 @@ public interface SqlRowSet extends Serializable { Object getObject(int columnIndex, Map> map) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnLabel the column label * @param map a Map object containing the mapping from SQL types to Java types * @return a Object representing the column value @@ -292,8 +269,7 @@ public interface SqlRowSet extends Serializable { Object getObject(String columnLabel, Map> map) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnIndex the column index * @param type the Java type to convert the designated column to * @return a Object representing the column value @@ -303,8 +279,7 @@ public interface SqlRowSet extends Serializable { T getObject(int columnIndex, Class type) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as an Object. + * Retrieve the value of the indicated column in the current row as an Object. * @param columnLabel the column label * @param type the Java type to convert the designated column to * @return a Object representing the column value @@ -314,8 +289,7 @@ public interface SqlRowSet extends Serializable { T getObject(String columnLabel, Class type) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a short. + * Retrieve the value of the indicated column in the current row as a short. * @param columnIndex the column index * @return a short representing the column value * @see java.sql.ResultSet#getShort(int) @@ -323,8 +297,7 @@ public interface SqlRowSet extends Serializable { short getShort(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a short. + * Retrieve the value of the indicated column in the current row as a short. * @param columnLabel the column label * @return a short representing the column value * @see java.sql.ResultSet#getShort(String) @@ -332,8 +305,7 @@ public interface SqlRowSet extends Serializable { short getShort(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a String. + * Retrieve the value of the indicated column in the current row as a String. * @param columnIndex the column index * @return a String representing the column value * @see java.sql.ResultSet#getString(int) @@ -341,8 +313,7 @@ public interface SqlRowSet extends Serializable { String getString(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a String. + * Retrieve the value of the indicated column in the current row as a String. * @param columnLabel the column label * @return a String representing the column value * @see java.sql.ResultSet#getString(String) @@ -350,8 +321,7 @@ public interface SqlRowSet extends Serializable { String getString(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Time object. + * Retrieve the value of the indicated column in the current row as a Time object. * @param columnIndex the column index * @return a Time object representing the column value * @see java.sql.ResultSet#getTime(int) @@ -359,8 +329,7 @@ public interface SqlRowSet extends Serializable { Time getTime(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Time object. + * Retrieve the value of the indicated column in the current row as a Time object. * @param columnLabel the column label * @return a Time object representing the column value * @see java.sql.ResultSet#getTime(String) @@ -368,8 +337,7 @@ public interface SqlRowSet extends Serializable { Time getTime(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Time object. + * Retrieve the value of the indicated column in the current row as a Time object. * @param columnIndex the column index * @param cal the Calendar to use in constructing the Date * @return a Time object representing the column value @@ -378,8 +346,7 @@ public interface SqlRowSet extends Serializable { Time getTime(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Time object. + * Retrieve the value of the indicated column in the current row as a Time object. * @param columnLabel the column label * @param cal the Calendar to use in constructing the Date * @return a Time object representing the column value @@ -388,8 +355,7 @@ public interface SqlRowSet extends Serializable { Time getTime(String columnLabel, Calendar cal) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Timestamp object. + * Retrieve the value of the indicated column in the current row as a Timestamp object. * @param columnIndex the column index * @return a Timestamp object representing the column value * @see java.sql.ResultSet#getTimestamp(int) @@ -397,8 +363,7 @@ public interface SqlRowSet extends Serializable { Timestamp getTimestamp(int columnIndex) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Timestamp object. + * Retrieve the value of the indicated column in the current row as a Timestamp object. * @param columnLabel the column label * @return a Timestamp object representing the column value * @see java.sql.ResultSet#getTimestamp(String) @@ -406,8 +371,7 @@ public interface SqlRowSet extends Serializable { Timestamp getTimestamp(String columnLabel) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Timestamp object. + * Retrieve the value of the indicated column in the current row as a Timestamp object. * @param columnIndex the column index * @param cal the Calendar to use in constructing the Date * @return a Timestamp object representing the column value @@ -416,8 +380,7 @@ public interface SqlRowSet extends Serializable { Timestamp getTimestamp(int columnIndex, Calendar cal) throws InvalidResultSetAccessException; /** - * Retrieve the value of the indicated column in the current row - * as a Timestamp object. + * Retrieve the value of the indicated column in the current row as a Timestamp object. * @param columnLabel the column label * @param cal the Calendar to use in constructing the Date * @return a Timestamp object representing the column value @@ -429,11 +392,9 @@ public interface SqlRowSet extends Serializable { // RowSet navigation methods /** - * Move the cursor to the given row number in the row set, - * just after the last row. + * Move the cursor to the given row number in the row set, just after the last row. * @param row the number of the row where the cursor should move - * @return {@code true} if the cursor is on the row set, - * {@code false} otherwise + * @return {@code true} if the cursor is on the row set, {@code false} otherwise * @see java.sql.ResultSet#absolute(int) */ boolean absolute(int row) throws InvalidResultSetAccessException; @@ -445,16 +406,14 @@ public interface SqlRowSet extends Serializable { void afterLast() throws InvalidResultSetAccessException; /** - * Move the cursor to the front of this row set, - * just before the first row. + * Move the cursor to the front of this row set, just before the first row. * @see java.sql.ResultSet#beforeFirst() */ void beforeFirst() throws InvalidResultSetAccessException; /** * Move the cursor to the first row of this row set. - * @return {@code true} if the cursor is on a valid row, - * {@code false} otherwise + * @return {@code true} if the cursor is on a valid row, {@code false} otherwise * @see java.sql.ResultSet#first() */ boolean first() throws InvalidResultSetAccessException; @@ -468,74 +427,65 @@ public interface SqlRowSet extends Serializable { /** * Retrieve whether the cursor is after the last row of this row set. - * @return {@code true} if the cursor is after the last row, - * {@code false} otherwise + * @return {@code true} if the cursor is after the last row, {@code false} otherwise * @see java.sql.ResultSet#isAfterLast() */ boolean isAfterLast() throws InvalidResultSetAccessException; /** * Retrieve whether the cursor is before the first row of this row set. - * @return {@code true} if the cursor is before the first row, - * {@code false} otherwise + * @return {@code true} if the cursor is before the first row, {@code false} otherwise * @see java.sql.ResultSet#isBeforeFirst() */ boolean isBeforeFirst() throws InvalidResultSetAccessException; /** * Retrieve whether the cursor is on the first row of this row set. - * @return {@code true} if the cursor is after the first row, - * {@code false} otherwise + * @return {@code true} if the cursor is after the first row, {@code false} otherwise * @see java.sql.ResultSet#isFirst() */ boolean isFirst() throws InvalidResultSetAccessException; /** * Retrieve whether the cursor is on the last row of this row set. - * @return {@code true} if the cursor is after the last row, - * {@code false} otherwise + * @return {@code true} if the cursor is after the last row, {@code false} otherwise * @see java.sql.ResultSet#isLast() */ boolean isLast() throws InvalidResultSetAccessException; /** * Move the cursor to the last row of this row set. - * @return {@code true} if the cursor is on a valid row, - * {@code false} otherwise + * @return {@code true} if the cursor is on a valid row, {@code false} otherwise * @see java.sql.ResultSet#last() */ boolean last() throws InvalidResultSetAccessException; /** * Move the cursor to the next row. - * @return {@code true} if the new row is valid, - * {@code false} if there are no more rows + * @return {@code true} if the new row is valid, {@code false} if there are no more rows * @see java.sql.ResultSet#next() */ boolean next() throws InvalidResultSetAccessException; /** * Move the cursor to the previous row. - * @return {@code true} if the new row is valid, - * {@code false} if it is off the row set + * @return {@code true} if the new row is valid, {@code false} if it is off the row set * @see java.sql.ResultSet#previous() */ boolean previous() throws InvalidResultSetAccessException; /** - * Move the cursor a relative number of rows, - * either positive or negative. - * @return {@code true} if the cursor is on a row, - * {@code false} otherwise + * Move the cursor a relative number of rows, either positive or negative. + * @return {@code true} if the cursor is on a row, {@code false} otherwise * @see java.sql.ResultSet#relative(int) */ boolean relative(int rows) throws InvalidResultSetAccessException; /** * Report whether the last column read had a value of SQL {@code NULL}. - *

    Note that you must first call one of the getter methods - * and then call the {@code wasNull()} method. - * @return {@code true} if the most recent coumn retrieved was + *

    Note that you must first call one of the getter methods and then + * call the {@code wasNull()} method. + * @return {@code true} if the most recent column retrieved was * SQL {@code NULL}, {@code false} otherwise * @see java.sql.ResultSet#wasNull() */