You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2018/06/11 19:12:13 UTC
commons-dbcp git commit: Better ivar name.
Repository: commons-dbcp
Updated Branches:
refs/heads/master 1ad8fa191 -> 31d3f3456
Better ivar name.
Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/31d3f345
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/31d3f345
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/31d3f345
Branch: refs/heads/master
Commit: 31d3f3456ca68f29b98ce5650dee94e1127dc805
Parents: 1ad8fa1
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Jun 11 13:12:08 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Jun 11 13:12:08 2018 -0600
----------------------------------------------------------------------
.../dbcp2/cpdsadapter/PooledConnectionImpl.java | 50 ++++++++++----------
1 file changed, 25 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/31d3f345/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
index 8015bed..c8bb55b 100644
--- a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
+++ b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/PooledConnectionImpl.java
@@ -82,7 +82,7 @@ class PooledConnectionImpl
private boolean isClosed;
/** My pool of {@link PreparedStatement}s. */
- private KeyedObjectPool<PStmtKey, DelegatingPreparedStatement> pstmtPool;
+ private KeyedObjectPool<PStmtKey, DelegatingPreparedStatement> pStmtPool;
/**
* Controls access to the underlying connection
@@ -161,11 +161,11 @@ class PooledConnectionImpl
assertOpen();
isClosed = true;
try {
- if (pstmtPool != null) {
+ if (pStmtPool != null) {
try {
- pstmtPool.close();
+ pStmtPool.close();
} finally {
- pstmtPool = null;
+ pStmtPool = null;
}
}
} catch (final RuntimeException e) {
@@ -343,11 +343,11 @@ class PooledConnectionImpl
if (key.getStmtType() == StatementType.PREPARED_STATEMENT ) {
final PreparedStatement statement = (PreparedStatement) key.createStatement(connection);
@SuppressWarnings({"rawtypes", "unchecked"}) // Unable to find way to avoid this
- final PoolablePreparedStatement pps = new PoolablePreparedStatement(statement, key, pstmtPool, delegatingConnection);
+ final PoolablePreparedStatement pps = new PoolablePreparedStatement(statement, key, pStmtPool, delegatingConnection);
return new DefaultPooledObject<DelegatingPreparedStatement>(pps);
}
final CallableStatement statement = (CallableStatement) key.createStatement(connection);
- final PoolableCallableStatement pcs = new PoolableCallableStatement(statement, key, pstmtPool,
+ final PoolableCallableStatement pcs = new PoolableCallableStatement(statement, key, pStmtPool,
(DelegatingConnection<Connection>) delegatingConnection);
return new DefaultPooledObject<DelegatingPreparedStatement>(pcs);
}
@@ -401,11 +401,11 @@ class PooledConnectionImpl
* @since 2.4.0
*/
CallableStatement prepareCall(final String sql) throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareCall(sql);
}
try {
- return (CallableStatement) pstmtPool.borrowObject(createKey(sql, StatementType.CALLABLE_STATEMENT));
+ return (CallableStatement) pStmtPool.borrowObject(createKey(sql, StatementType.CALLABLE_STATEMENT));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -433,11 +433,11 @@ class PooledConnectionImpl
* @since 2.4.0
*/
CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency) throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency);
}
try {
- return (CallableStatement) pstmtPool.borrowObject(createKey(sql, resultSetType, resultSetConcurrency, StatementType.CALLABLE_STATEMENT));
+ return (CallableStatement) pStmtPool.borrowObject(createKey(sql, resultSetType, resultSetConcurrency, StatementType.CALLABLE_STATEMENT));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -469,11 +469,11 @@ class PooledConnectionImpl
*/
CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency,
final int resultSetHoldability) throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareCall(sql, resultSetType, resultSetConcurrency, resultSetHoldability);
}
try {
- return (CallableStatement) pstmtPool.borrowObject(createKey(sql, resultSetType, resultSetConcurrency, resultSetHoldability, StatementType.CALLABLE_STATEMENT));
+ return (CallableStatement) pStmtPool.borrowObject(createKey(sql, resultSetType, resultSetConcurrency, resultSetHoldability, StatementType.CALLABLE_STATEMENT));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -489,11 +489,11 @@ class PooledConnectionImpl
* @return a {@link PoolablePreparedStatement}
*/
PreparedStatement prepareStatement(final String sql) throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql);
}
try {
- return pstmtPool.borrowObject(createKey(sql));
+ return pStmtPool.borrowObject(createKey(sql));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -514,11 +514,11 @@ class PooledConnectionImpl
*/
PreparedStatement prepareStatement(final String sql, final int autoGeneratedKeys)
throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql, autoGeneratedKeys);
}
try {
- return pstmtPool.borrowObject(createKey(sql,autoGeneratedKeys));
+ return pStmtPool.borrowObject(createKey(sql,autoGeneratedKeys));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -528,11 +528,11 @@ class PooledConnectionImpl
PreparedStatement prepareStatement(final String sql, final int columnIndexes[])
throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql, columnIndexes);
}
try {
- return pstmtPool.borrowObject(createKey(sql, columnIndexes));
+ return pStmtPool.borrowObject(createKey(sql, columnIndexes));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -559,11 +559,11 @@ class PooledConnectionImpl
PreparedStatement prepareStatement(final String sql, final int resultSetType,
final int resultSetConcurrency)
throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql, resultSetType, resultSetConcurrency);
}
try {
- return pstmtPool.borrowObject(
+ return pStmtPool.borrowObject(
createKey(sql,resultSetType,resultSetConcurrency));
} catch (final RuntimeException e) {
throw e;
@@ -575,12 +575,12 @@ class PooledConnectionImpl
PreparedStatement prepareStatement(final String sql, final int resultSetType,
final int resultSetConcurrency, final int resultSetHoldability)
throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql, resultSetType,
resultSetConcurrency, resultSetHoldability);
}
try {
- return pstmtPool.borrowObject(createKey(sql, resultSetType,
+ return pStmtPool.borrowObject(createKey(sql, resultSetType,
resultSetConcurrency, resultSetHoldability));
} catch (final RuntimeException e) {
throw e;
@@ -591,11 +591,11 @@ class PooledConnectionImpl
PreparedStatement prepareStatement(final String sql, final String columnNames[])
throws SQLException {
- if (pstmtPool == null) {
+ if (pStmtPool == null) {
return connection.prepareStatement(sql, columnNames);
}
try {
- return pstmtPool.borrowObject(createKey(sql, columnNames));
+ return pStmtPool.borrowObject(createKey(sql, columnNames));
} catch (final RuntimeException e) {
throw e;
} catch (final Exception e) {
@@ -632,7 +632,7 @@ class PooledConnectionImpl
public void setStatementPool(
final KeyedObjectPool<PStmtKey, DelegatingPreparedStatement> statementPool) {
- pstmtPool = statementPool;
+ pStmtPool = statementPool;
}
/**