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/13 17:28:32 UTC
[10/50] [abbrv] commons-dbcp git commit: Line length 120 and standard
formatting.
Line length 120 and standard formatting.
Project: http://git-wip-us.apache.org/repos/asf/commons-dbcp/repo
Commit: http://git-wip-us.apache.org/repos/asf/commons-dbcp/commit/cb48137d
Tree: http://git-wip-us.apache.org/repos/asf/commons-dbcp/tree/cb48137d
Diff: http://git-wip-us.apache.org/repos/asf/commons-dbcp/diff/cb48137d
Branch: refs/heads/release
Commit: cb48137d5ab27db5da09ee3940c2cf93fa47fcc6
Parents: cc7f070
Author: Gary Gregory <ga...@gmail.com>
Authored: Mon Jun 11 17:42:43 2018 -0600
Committer: Gary Gregory <ga...@gmail.com>
Committed: Mon Jun 11 17:42:43 2018 -0600
----------------------------------------------------------------------
.../dbcp2/cpdsadapter/ConnectionImpl.java | 77 ++++++++------------
1 file changed, 31 insertions(+), 46 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/commons-dbcp/blob/cb48137d/src/main/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
----------------------------------------------------------------------
diff --git a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
index ec2155e..2226e8e 100644
--- a/src/main/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
+++ b/src/main/java/org/apache/commons/dbcp2/cpdsadapter/ConnectionImpl.java
@@ -35,6 +35,7 @@ import org.apache.commons.dbcp2.DelegatingPreparedStatement;
* <p>
* ConnectionImpl extends DelegatingConnection to enable access to the underlying connection.
* </p>
+ *
* @since 2.0
*/
class ConnectionImpl extends DelegatingConnection<Connection> {
@@ -42,22 +43,23 @@ class ConnectionImpl extends DelegatingConnection<Connection> {
private final boolean accessToUnderlyingConnectionAllowed;
/** The object that instantiated this object */
- private final PooledConnectionImpl pooledConnection;
+ private final PooledConnectionImpl pooledConnection;
/**
* Creates a <code>ConnectionImpl</code>.
*
- * @param pooledConnection The PooledConnection that is calling the ctor.
- * @param connection The JDBC 1.x Connection to wrap.
- * @param accessToUnderlyingConnectionAllowed if true, then access is allowed to the underlying connection
+ * @param pooledConnection
+ * The PooledConnection that is calling the ctor.
+ * @param connection
+ * The JDBC 1.x Connection to wrap.
+ * @param accessToUnderlyingConnectionAllowed
+ * if true, then access is allowed to the underlying connection
*/
- ConnectionImpl(final PooledConnectionImpl pooledConnection,
- final Connection connection,
+ ConnectionImpl(final PooledConnectionImpl pooledConnection, final Connection connection,
final boolean accessToUnderlyingConnectionAllowed) {
super(connection);
this.pooledConnection = pooledConnection;
- this.accessToUnderlyingConnectionAllowed =
- accessToUnderlyingConnectionAllowed;
+ this.accessToUnderlyingConnectionAllowed = accessToUnderlyingConnectionAllowed;
}
/**
@@ -126,7 +128,8 @@ class ConnectionImpl extends DelegatingConnection<Connection> {
* @since 2.4.0
*/
@Override
- public CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency) throws SQLException {
+ public CallableStatement prepareCall(final String sql, final int resultSetType, final int resultSetConcurrency)
+ throws SQLException {
checkOpen();
try {
return new DelegatingCallableStatement(this,
@@ -187,10 +190,8 @@ class ConnectionImpl extends DelegatingConnection<Connection> {
public PreparedStatement prepareStatement(final String sql) throws SQLException {
checkOpen();
try {
- return new DelegatingPreparedStatement
- (this, pooledConnection.prepareStatement(sql));
- }
- catch (final SQLException e) {
+ return new DelegatingPreparedStatement(this, pooledConnection.prepareStatement(sql));
+ } catch (final SQLException e) {
handleException(e); // Does not return
return null;
}
@@ -204,75 +205,59 @@ class ConnectionImpl extends DelegatingConnection<Connection> {
* if this connection is closed or an error occurs in the wrapped connection.
*/
@Override
- public PreparedStatement prepareStatement(final String sql, final int resultSetType,
- final int resultSetConcurrency)
+ public PreparedStatement prepareStatement(final String sql, final int resultSetType, final int resultSetConcurrency)
throws SQLException {
checkOpen();
try {
- return new DelegatingPreparedStatement
- (this, pooledConnection.prepareStatement
- (sql,resultSetType,resultSetConcurrency));
- }
- catch (final SQLException e) {
+ return new DelegatingPreparedStatement(this,
+ pooledConnection.prepareStatement(sql, resultSetType, resultSetConcurrency));
+ } catch (final SQLException e) {
handleException(e);
return null;
}
}
@Override
- public PreparedStatement prepareStatement(final String sql, final int resultSetType,
- final int resultSetConcurrency,
- final int resultSetHoldability)
- throws SQLException {
+ public PreparedStatement prepareStatement(final String sql, final int resultSetType, final int resultSetConcurrency,
+ final int resultSetHoldability) throws SQLException {
checkOpen();
try {
return new DelegatingPreparedStatement(this,
- pooledConnection.prepareStatement(sql, resultSetType,
- resultSetConcurrency, resultSetHoldability));
- }
- catch (final SQLException e) {
+ pooledConnection.prepareStatement(sql, resultSetType, resultSetConcurrency, resultSetHoldability));
+ } catch (final SQLException e) {
handleException(e);
return null;
}
}
@Override
- public PreparedStatement prepareStatement(final String sql, final int autoGeneratedKeys)
- throws SQLException {
+ public PreparedStatement prepareStatement(final String sql, final int autoGeneratedKeys) throws SQLException {
checkOpen();
try {
- return new DelegatingPreparedStatement(this,
- pooledConnection.prepareStatement(sql, autoGeneratedKeys));
- }
- catch (final SQLException e) {
+ return new DelegatingPreparedStatement(this, pooledConnection.prepareStatement(sql, autoGeneratedKeys));
+ } catch (final SQLException e) {
handleException(e);
return null;
}
}
@Override
- public PreparedStatement prepareStatement(final String sql, final int columnIndexes[])
- throws SQLException {
+ public PreparedStatement prepareStatement(final String sql, final int columnIndexes[]) throws SQLException {
checkOpen();
try {
- return new DelegatingPreparedStatement(this,
- pooledConnection.prepareStatement(sql, columnIndexes));
- }
- catch (final SQLException e) {
+ return new DelegatingPreparedStatement(this, pooledConnection.prepareStatement(sql, columnIndexes));
+ } catch (final SQLException e) {
handleException(e);
return null;
}
}
@Override
- public PreparedStatement prepareStatement(final String sql, final String columnNames[])
- throws SQLException {
+ public PreparedStatement prepareStatement(final String sql, final String columnNames[]) throws SQLException {
checkOpen();
try {
- return new DelegatingPreparedStatement(this,
- pooledConnection.prepareStatement(sql, columnNames));
- }
- catch (final SQLException e) {
+ return new DelegatingPreparedStatement(this, pooledConnection.prepareStatement(sql, columnNames));
+ } catch (final SQLException e) {
handleException(e);
return null;
}