Skip to content

Commit 3fef358

Browse files
committed
JDBC 3.0 related javadoc overhaul
Issue: SPR-11600
1 parent 3767938 commit 3fef358

File tree

8 files changed

+60
-42
lines changed

8 files changed

+60
-42
lines changed

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/HsqlTableMetaDataProvider.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,8 +20,9 @@
2020
import java.sql.SQLException;
2121

2222
/**
23-
* The HSQL specific implementation of the {@link TableMetaDataProvider}.
24-
* Supports a feature for retreiving generated keys without the JDBC 3.0 getGeneratedKeys support.
23+
* The HSQL specific implementation of {@link TableMetaDataProvider}.
24+
* Supports a feature for retrieving generated keys without the JDBC 3.0
25+
* {@code getGeneratedKeys} support.
2526
*
2627
* @author Thomas Risberg
2728
* @since 2.5

spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/PostgresTableMetaDataProvider.java

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2011 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,8 +20,9 @@
2020
import java.sql.SQLException;
2121

2222
/**
23-
* The PostgreSQL specific implementation of the {@link org.springframework.jdbc.core.metadata.TableMetaDataProvider}.
24-
* Suports a feature for retreiving generated keys without the JDBC 3.0 getGeneratedKeys support.
23+
* The PostgreSQL specific implementation of {@link TableMetaDataProvider}.
24+
* Supports a feature for retrieving generated keys without the JDBC 3.0
25+
* {@code getGeneratedKeys} support.
2526
*
2627
* @author Thomas Risberg
2728
* @since 2.5
@@ -38,7 +39,10 @@ public boolean isGetGeneratedKeysSimulated() {
3839
return true;
3940
}
4041
else {
41-
logger.warn("PostgreSQL does not support getGeneratedKeys or INSERT ... RETURNING in version " + getDatabaseVersion());
42+
if (logger.isWarnEnabled()) {
43+
logger.warn("PostgreSQL does not support getGeneratedKeys or INSERT ... RETURNING in version " +
44+
getDatabaseVersion());
45+
}
4246
return false;
4347
}
4448
}
@@ -47,4 +51,5 @@ public boolean isGetGeneratedKeysSimulated() {
4751
public String getSimpleQueryForGetGeneratedKey(String tableName, String keyColumnName) {
4852
return "RETURNING " + keyColumnName;
4953
}
54+
5055
}

spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceTransactionManager.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2013 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -33,10 +33,9 @@
3333
* {@link org.springframework.transaction.PlatformTransactionManager}
3434
* implementation for a single JDBC {@link javax.sql.DataSource}. This class is
3535
* capable of working in any environment with any JDBC driver, as long as the setup
36-
* uses a JDBC 2.0 Standard Extensions / JDBC 3.0 {@code javax.sql.DataSource}
37-
* as its Connection factory mechanism. Binds a JDBC Connection from the specified
38-
* DataSource to the current thread, potentially allowing for one thread-bound
39-
* Connection per DataSource.
36+
* uses a {@code javax.sql.DataSource} as its {@code Connection} factory mechanism.
37+
* Binds a JDBC Connection from the specified DataSource to the current thread,
38+
* potentially allowing for one thread-bound Connection per DataSource.
4039
*
4140
* <p><b>Note: The DataSource that this transaction manager operates on needs
4241
* to return independent Connections.</b> The Connections may come from a pool
@@ -75,8 +74,8 @@
7574
* an actual JDBC Connection from the target DataSource until a Statement gets executed,
7675
* lazily applying the specified transaction settings to the target Connection.
7776
*
78-
* <p>On JDBC 3.0, this transaction manager supports nested transactions via the
79-
* JDBC 3.0 {@link java.sql.Savepoint} mechanism. The
77+
* <p>This transaction manager supports nested transactions via the JDBC 3.0
78+
* {@link java.sql.Savepoint} mechanism. The
8079
* {@link #setNestedTransactionAllowed "nestedTransactionAllowed"} flag defaults
8180
* to "true", since nested transactions will work without restrictions on JDBC
8281
* drivers that support savepoints (such as the Oracle JDBC driver).

spring-jdbc/src/main/java/org/springframework/jdbc/object/StoredProcedure.java

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
1616

1717
package org.springframework.jdbc.object;
1818

19-
import java.util.Map;
2019
import java.util.HashMap;
20+
import java.util.Map;
2121
import javax.sql.DataSource;
2222

2323
import org.springframework.dao.DataAccessException;
@@ -33,9 +33,7 @@
3333
* {@link #execute} method.
3434
*
3535
* <p>The inherited {@code sql} property is the name of the stored
36-
* procedure in the RDBMS. Note that JDBC 3.0 introduces named parameters,
37-
* although the other features provided by this class are still necessary
38-
* in JDBC 3.0.
36+
* procedure in the RDBMS.
3937
*
4038
* @author Rod Johnson
4139
* @author Thomas Risberg

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/DerbyMaxValueIncrementer.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,6 @@
2020
import java.sql.ResultSet;
2121
import java.sql.SQLException;
2222
import java.sql.Statement;
23-
2423
import javax.sql.DataSource;
2524

2625
import org.springframework.dao.DataAccessException;
@@ -51,7 +50,7 @@
5150
* is rolled back, the unused values will never be served. The maximum hole size in
5251
* numbering is consequently the value of cacheSize.
5352
*
54-
* <b>HINT:</b> Since Derby supports the JDBC 3.0 {@code getGeneratedKeys} method,
53+
* <b>HINT:</b> Since Derby supports the JDBC 3.0 {@code getGeneratedKeys} method,
5554
* it is recommended to use IDENTITY columns directly in the tables and then utilizing
5655
* a {@link org.springframework.jdbc.support.KeyHolder} when calling the with the
5756
* {@code update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)}

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SqlServerMaxValueIncrementer.java

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,32 @@
1+
/*
2+
* Copyright 2002-2014 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* http://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
117
package org.springframework.jdbc.support.incrementer;
218

19+
import java.sql.Connection;
20+
import java.sql.ResultSet;
21+
import java.sql.SQLException;
22+
import java.sql.Statement;
23+
import javax.sql.DataSource;
24+
325
import org.springframework.dao.DataAccessException;
426
import org.springframework.dao.DataAccessResourceFailureException;
527
import org.springframework.jdbc.datasource.DataSourceUtils;
628
import org.springframework.jdbc.support.JdbcUtils;
729

8-
import javax.sql.DataSource;
9-
import java.sql.Connection;
10-
import java.sql.Statement;
11-
import java.sql.ResultSet;
12-
import java.sql.SQLException;
13-
1430
/**
1531
* {@link DataFieldMaxValueIncrementer} that increments the maximum value of a given SQL Server table
1632
* with the equivalent of an auto-increment column. Note: If you use this class, your Derby key
@@ -32,8 +48,8 @@
3248
* is rolled back, the unused values will never be served. The maximum hole size in
3349
* numbering is consequently the value of cacheSize.
3450
*
35-
* <b>HINT:</b> Since Microsoft SQL Server supports the JDBC 3.0 {@code getGeneratedKeys} method,
36-
* it is recommended to use IDENTITY columns directly in the tables and then using a
51+
* <b>HINT:</b> Since Microsoft SQL Server supports the JDBC 3.0 {@code getGeneratedKeys}
52+
* method, it is recommended to use IDENTITY columns directly in the tables and then using a
3753
* {@link org.springframework.jdbc.core.simple.SimpleJdbcInsert} or utilizing
3854
* a {@link org.springframework.jdbc.support.KeyHolder} when calling the with the
3955
* {@code update(PreparedStatementCreator psc, KeyHolder generatedKeyHolder)}

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SybaseAnywhereMaxValueIncrementer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -40,7 +40,7 @@
4040
* is rolled back, the unused values will never be served. The maximum hole size in
4141
* numbering is consequently the value of cacheSize.
4242
*
43-
* <b>HINT:</b> Since Sybase Anywhere supports the JDBC 3.0 {@code getGeneratedKeys} method,
43+
* <b>HINT:</b> Since Sybase Anywhere supports the JDBC 3.0 {@code getGeneratedKeys} method,
4444
* it is recommended to use IDENTITY columns directly in the tables and then using a
4545
* {@link org.springframework.jdbc.core.simple.SimpleJdbcInsert} or utilizing
4646
* a {@link org.springframework.jdbc.support.KeyHolder} when calling the with the

spring-jdbc/src/main/java/org/springframework/jdbc/support/incrementer/SybaseMaxValueIncrementer.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2012 the original author or authors.
2+
* Copyright 2002-2014 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -16,17 +16,17 @@
1616

1717
package org.springframework.jdbc.support.incrementer;
1818

19+
import java.sql.Connection;
20+
import java.sql.ResultSet;
21+
import java.sql.SQLException;
22+
import java.sql.Statement;
23+
import javax.sql.DataSource;
24+
1925
import org.springframework.dao.DataAccessException;
2026
import org.springframework.dao.DataAccessResourceFailureException;
2127
import org.springframework.jdbc.datasource.DataSourceUtils;
2228
import org.springframework.jdbc.support.JdbcUtils;
2329

24-
import javax.sql.DataSource;
25-
import java.sql.Connection;
26-
import java.sql.Statement;
27-
import java.sql.ResultSet;
28-
import java.sql.SQLException;
29-
3030
/**
3131
* {@link DataFieldMaxValueIncrementer} that increments
3232
* the maximum value of a given Sybase SQL Server table
@@ -49,7 +49,7 @@
4949
* is rolled back, the unused values will never be served. The maximum hole size in
5050
* numbering is consequently the value of cacheSize.
5151
*
52-
* <b>HINT:</b> Since Sybase supports the JDBC 3.0 {@code getGeneratedKeys} method,
52+
* <b>HINT:</b> Since Sybase supports the JDBC 3.0 {@code getGeneratedKeys} method,
5353
* it is recommended to use IDENTITY columns directly in the tables and then using a
5454
* {@link org.springframework.jdbc.core.simple.SimpleJdbcInsert} or utilizing
5555
* a {@link org.springframework.jdbc.support.KeyHolder} when calling the with the
@@ -133,8 +133,8 @@ protected synchronized long getNextKey() throws DataAccessException {
133133
}
134134

135135
/**
136-
* Statement to use to increment the "sequence" value. Can be overridden by sub-classes.
137-
* @return The SQL statement to use
136+
* Statement to use to increment the "sequence" value. Can be overridden by subclasses.
137+
* @return the SQL statement to use
138138
*/
139139
protected String getIncrementStatement() {
140140
return "insert into " + getIncrementerName() + " values()";

0 commit comments

Comments
 (0)