This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/11.0.x by this push:
new 7ece193e15 Better alignment with DBCP
7ece193e15 is described below
commit 7ece193e15ce097f5dc6b74bcb7a9ec1d2ab0514
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Mar 5 13:02:03 2026 +0000
Better alignment with DBCP
---
.../dbcp/dbcp2/DelegatingDatabaseMetaData.java | 6 +-
.../tomcat/dbcp/dbcp2/DelegatingResultSet.java | 8 +-
java/org/apache/tomcat/dbcp/dbcp2/PStmtKey.java | 129 +++++++++++----------
.../datasources/SharedPoolDataSourceFactory.java | 2 +-
4 files changed, 73 insertions(+), 72 deletions(-)
diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java
b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java
index a8c2d0f397..77793fc5af 100644
--- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java
+++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingDatabaseMetaData.java
@@ -264,13 +264,13 @@ public class DelegatingDatabaseMetaData implements
DatabaseMetaData {
}
/**
- * If my underlying {@link ResultSet} is not a {@code
DelegatingResultSet}, returns it, otherwise recursively invokes this method on
my delegate.
+ * If my underlying {@link ResultSet} is not a {@link
DelegatingResultSet}, returns it, otherwise recursively invokes this method on
my delegate.
* <p>
- * Hence this method will return the first delegate that is not a {@code
DelegatingResultSet}, or {@code null} when no non-{@code DelegatingResultSet}
+ * Hence this method will return the first delegate that is not a {@link
DelegatingResultSet}, or {@code null} when no non-{@link DelegatingResultSet}
* delegate can be found by traversing this chain.
* </p>
* <p>
- * This method is useful when you may have nested {@code
DelegatingResultSet}s, and you want to make sure to obtain a "genuine" {@link
ResultSet}.
+ * This method is useful when you may have nested {@link
DelegatingResultSet}s, and you want to make sure to obtain a "genuine" {@link
ResultSet}.
* </p>
*
* @return the innermost database meta data.
diff --git a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java
b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java
index c40c1f8bac..e56b232d84 100644
--- a/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java
+++ b/java/org/apache/tomcat/dbcp/dbcp2/DelegatingResultSet.java
@@ -595,14 +595,14 @@ public final class DelegatingResultSet extends
AbandonedTrace implements ResultS
}
/**
- * If my underlying {@link ResultSet} is not a {@code
DelegatingResultSet}, returns it, otherwise recursively
+ * If my underlying {@link ResultSet} is not a {@link
DelegatingResultSet}, returns it, otherwise recursively
* invokes this method on my delegate.
* <p>
- * Hence this method will return the first delegate that is not a {@code
DelegatingResultSet}, or {@code null} when
- * no non-{@code DelegatingResultSet} delegate can be found by traversing
this chain.
+ * Hence this method will return the first delegate that is not a {@link
DelegatingResultSet}, or {@code null} when
+ * no non-{@link DelegatingResultSet} delegate can be found by traversing
this chain.
* </p>
* <p>
- * This method is useful when you may have nested {@code
DelegatingResultSet}s, and you want to make sure to obtain
+ * This method is useful when you may have nested {@link
DelegatingResultSet}s, and you want to make sure to obtain
* a "genuine" {@link ResultSet}.
* </p>
*
diff --git a/java/org/apache/tomcat/dbcp/dbcp2/PStmtKey.java
b/java/org/apache/tomcat/dbcp/dbcp2/PStmtKey.java
index 40c85522ec..7b1936c717 100644
--- a/java/org/apache/tomcat/dbcp/dbcp2/PStmtKey.java
+++ b/java/org/apache/tomcat/dbcp/dbcp2/PStmtKey.java
@@ -17,6 +17,7 @@
package org.apache.tomcat.dbcp.dbcp2;
import java.sql.Connection;
+import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
@@ -68,20 +69,20 @@ public class PStmtKey {
private final String sql;
/**
- * Result set type; one of {@code ResultSet.TYPE_FORWARD_ONLY}, {@code
ResultSet.TYPE_SCROLL_INSENSITIVE}, or
- * {@code ResultSet.TYPE_SCROLL_SENSITIVE}.
+ * Result set type; one of {@link ResultSet#TYPE_FORWARD_ONLY}, {@link
ResultSet#TYPE_SCROLL_INSENSITIVE}, or
+ * {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
*/
private final Integer resultSetType;
/**
- * Result set concurrency. A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * Result set concurrency. A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
*/
private final Integer resultSetConcurrency;
/**
- * Result set holdability. One of the following {@code ResultSet}
constants: {@code ResultSet.HOLD_CURSORS_OVER_COMMIT}
- * or {@code ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * Result set holdability. One of the following {@link ResultSet}
constants: {@link ResultSet#HOLD_CURSORS_OVER_COMMIT}
+ * or {@link ResultSet#CLOSE_CURSORS_AT_COMMIT}.
*/
private final Integer resultSetHoldability;
@@ -96,8 +97,8 @@ public class PStmtKey {
private final String schema;
/**
- * A flag indicating whether auto-generated keys should be returned; one
of {@code Statement.RETURN_GENERATED_KEYS} or
- * {@code Statement.NO_GENERATED_KEYS}.
+ * A flag indicating whether auto-generated keys should be returned; one
of {@link Statement#RETURN_GENERATED_KEYS} or
+ * {@link Statement#NO_GENERATED_KEYS}.
*/
private final Integer autoGeneratedKeys;
@@ -136,10 +137,10 @@ public class PStmtKey {
* Constructs a key to uniquely identify a prepared statement.
*
* @param sql The SQL statement.
- * @param resultSetType A result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * @param resultSetType A result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
* @deprecated Use {@link #PStmtKey(String, String, String, int, int)}.
*/
@Deprecated
@@ -165,7 +166,7 @@ public class PStmtKey {
* @param sql The SQL statement.
* @param catalog The catalog.
* @param autoGeneratedKeys A flag indicating whether auto-generated keys
should be returned; one of
- * {@code Statement.RETURN_GENERATED_KEYS} or {@code
Statement.NO_GENERATED_KEYS}.
+ * {@link Statement#RETURN_GENERATED_KEYS} or {@link
Statement#NO_GENERATED_KEYS}.
* @deprecated Use {@link #PStmtKey(String, String, String, int)}.
*/
@Deprecated
@@ -178,10 +179,10 @@ public class PStmtKey {
*
* @param sql The SQL statement.
* @param catalog The catalog.
- * @param resultSetType A result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * @param resultSetType A result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
* @deprecated Use {@link #PStmtKey(String, String, String, int, int)}.
*/
@Deprecated
@@ -194,12 +195,12 @@ public class PStmtKey {
*
* @param sql The SQL statement.
* @param catalog The catalog.
- * @param resultSetType a result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}
- * @param resultSetHoldability One of the following {@code ResultSet}
constants:
- * {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code
ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * @param resultSetType a result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}
+ * @param resultSetHoldability One of the following {@link ResultSet}
constants:
+ * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT} or {@link
ResultSet#CLOSE_CURSORS_AT_COMMIT}.
* @deprecated Use {@link #PStmtKey(String, String, String, int, int,
int)}.
*/
@Deprecated
@@ -212,12 +213,12 @@ public class PStmtKey {
*
* @param sql The SQL statement.
* @param catalog The catalog.
- * @param resultSetType a result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
- * @param resultSetHoldability One of the following {@code ResultSet}
constants:
- * {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code
ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * @param resultSetType a result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
+ * @param resultSetHoldability One of the following {@link ResultSet}
constants:
+ * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT} or {@link
ResultSet#CLOSE_CURSORS_AT_COMMIT}.
* @param statementType The SQL statement type, prepared or callable.
* @deprecated Use {@link #PStmtKey(String, String, String, int, int, int,
PoolingConnection.StatementType)}
*/
@@ -233,10 +234,10 @@ public class PStmtKey {
*
* @param sql The SQL statement.
* @param catalog The catalog.
- * @param resultSetType A result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * @param resultSetType A result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
* @param statementType The SQL statement type, prepared or callable.
* @deprecated Use {@link #PStmtKey(String, String, String, int, int,
PoolingConnection.StatementType)}.
*/
@@ -280,7 +281,7 @@ public class PStmtKey {
* @param catalog The catalog.
* @param statementType The SQL statement type, prepared or callable.
* @param autoGeneratedKeys A flag indicating whether auto-generated keys
should be returned; one of
- * {@code Statement.RETURN_GENERATED_KEYS} or {@code
Statement.NO_GENERATED_KEYS}.
+ * {@link Statement#RETURN_GENERATED_KEYS} or {@link
Statement#NO_GENERATED_KEYS}.
* @deprecated Use {@link #PStmtKey(String, String, String,
PoolingConnection.StatementType, Integer)}
*/
@Deprecated
@@ -308,7 +309,7 @@ public class PStmtKey {
* @param catalog The catalog.
* @param schema The schema
* @param autoGeneratedKeys A flag indicating whether auto-generated keys
should be returned; one of
- * {@code Statement.RETURN_GENERATED_KEYS} or {@code
Statement.NO_GENERATED_KEYS}.
+ * {@link Statement#RETURN_GENERATED_KEYS} or {@link
Statement#NO_GENERATED_KEYS}.
* @since 2.5.0
*/
public PStmtKey(final String sql, final String catalog, final String
schema, final int autoGeneratedKeys) {
@@ -321,10 +322,10 @@ public class PStmtKey {
* @param sql The SQL statement.
* @param catalog The catalog.
* @param schema The schema
- * @param resultSetType A result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * @param resultSetType A result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
*/
public PStmtKey(final String sql, final String catalog, final String
schema, final int resultSetType, final int resultSetConcurrency) {
this(sql, catalog, schema, resultSetType, resultSetConcurrency,
StatementType.PREPARED_STATEMENT);
@@ -336,12 +337,12 @@ public class PStmtKey {
* @param sql The SQL statement.
* @param catalog The catalog.
* @param schema The schema
- * @param resultSetType a result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}
- * @param resultSetHoldability One of the following {@code ResultSet}
constants:
- * {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code
ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * @param resultSetType a result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}
+ * @param resultSetHoldability One of the following {@link ResultSet}
constants:
+ * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT} or {@link
ResultSet#CLOSE_CURSORS_AT_COMMIT}.
* @since 2.5.0
*/
public PStmtKey(final String sql, final String catalog, final String
schema, final int resultSetType, final int resultSetConcurrency,
@@ -355,12 +356,12 @@ public class PStmtKey {
* @param sql The SQL statement.
* @param catalog The catalog.
* @param schema The schema.
- * @param resultSetType a result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
- * @param resultSetHoldability One of the following {@code ResultSet}
constants:
- * {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code
ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * @param resultSetType a result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
+ * @param resultSetHoldability One of the following {@link ResultSet}
constants:
+ * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT} or {@link
ResultSet#CLOSE_CURSORS_AT_COMMIT}.
* @param statementType The SQL statement type, prepared or callable.
* @since 2.5.0
*/
@@ -376,10 +377,10 @@ public class PStmtKey {
* @param sql The SQL statement.
* @param catalog The catalog.
* @param schema The schema.
- * @param resultSetType A result set type; one of {@code
ResultSet.TYPE_FORWARD_ONLY},
- * {@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or {@code
ResultSet.TYPE_SCROLL_SENSITIVE}.
- * @param resultSetConcurrency A concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * @param resultSetType A result set type; one of {@link
ResultSet#TYPE_FORWARD_ONLY},
+ * {@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or {@link
ResultSet#TYPE_SCROLL_SENSITIVE}.
+ * @param resultSetConcurrency A concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
* @param statementType The SQL statement type, prepared or callable.
* @since 2.5.0
*/
@@ -456,7 +457,7 @@ public class PStmtKey {
* @param schema The schema.
* @param statementType The SQL statement type, prepared or callable.
* @param autoGeneratedKeys A flag indicating whether auto-generated keys
should be returned; one of
- * {@code Statement.RETURN_GENERATED_KEYS} or {@code
Statement.NO_GENERATED_KEYS}.
+ * {@link Statement#RETURN_GENERATED_KEYS} or {@link
Statement#NO_GENERATED_KEYS}.
* @since 2.5.0
*/
public PStmtKey(final String sql, final String catalog, final String
schema, final StatementType statementType, final Integer autoGeneratedKeys) {
@@ -535,8 +536,8 @@ public class PStmtKey {
}
/**
- * Gets a flag indicating whether auto-generated keys should be returned;
one of {@code Statement.RETURN_GENERATED_KEYS}
- * or {@code Statement.NO_GENERATED_KEYS}.
+ * Gets a flag indicating whether auto-generated keys should be returned;
one of {@link Statement#RETURN_GENERATED_KEYS}
+ * or {@link Statement#NO_GENERATED_KEYS}.
*
* @return a flag indicating whether auto-generated keys should be
returned.
*/
@@ -572,8 +573,8 @@ public class PStmtKey {
}
/**
- * Gets the result set concurrency type; one of {@code
ResultSet.CONCUR_READ_ONLY} or
- * {@code ResultSet.CONCUR_UPDATABLE}.
+ * Gets the result set concurrency type; one of {@link
ResultSet#CONCUR_READ_ONLY} or
+ * {@link ResultSet#CONCUR_UPDATABLE}.
*
* @return The result set concurrency type.
*/
@@ -582,8 +583,8 @@ public class PStmtKey {
}
/**
- * Gets the result set holdability, one of the following {@code ResultSet}
constants:
- * {@code ResultSet.HOLD_CURSORS_OVER_COMMIT} or {@code
ResultSet.CLOSE_CURSORS_AT_COMMIT}.
+ * Gets the result set holdability, one of the following {@link ResultSet}
constants:
+ * {@link ResultSet#HOLD_CURSORS_OVER_COMMIT} or {@link
ResultSet#CLOSE_CURSORS_AT_COMMIT}.
*
* @return The result set holdability.
*/
@@ -592,8 +593,8 @@ public class PStmtKey {
}
/**
- * Gets the result set type, one of {@code ResultSet.TYPE_FORWARD_ONLY},
{@code ResultSet.TYPE_SCROLL_INSENSITIVE}, or
- * {@code ResultSet.TYPE_SCROLL_SENSITIVE}.
+ * Gets the result set type, one of {@link ResultSet#TYPE_FORWARD_ONLY},
{@link ResultSet#TYPE_SCROLL_INSENSITIVE}, or
+ * {@link ResultSet#TYPE_SCROLL_SENSITIVE}.
*
* @return the result set type.
*/
diff --git
a/java/org/apache/tomcat/dbcp/dbcp2/datasources/SharedPoolDataSourceFactory.java
b/java/org/apache/tomcat/dbcp/dbcp2/datasources/SharedPoolDataSourceFactory.java
index a0a349edb5..c1efa3ba0f 100644
---
a/java/org/apache/tomcat/dbcp/dbcp2/datasources/SharedPoolDataSourceFactory.java
+++
b/java/org/apache/tomcat/dbcp/dbcp2/datasources/SharedPoolDataSourceFactory.java
@@ -20,7 +20,7 @@ import javax.naming.RefAddr;
import javax.naming.Reference;
/**
- * A JNDI ObjectFactory which creates {@code SharedPoolDataSource}s
+ * A JNDI ObjectFactory which creates {@link SharedPoolDataSource}s
*
* @since 2.0
*/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]