In-line local variable that is not needed.
package org.apache.commons.dbcp2;
import java.sql.Connection;
-import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Arrays;
@@ -576,8 +575,7 @@ public class PStmtKey {
private class PreparedStatementSQL implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql);
- return statement;
+ return connection.prepareStatement(sql);
}
}
@@ -587,8 +585,7 @@ public class PStmtKey {
private class PreparedStatementWithAutoGeneratedKeys implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql, autoGeneratedKeys.intValue());
- return statement;
+ return connection.prepareStatement(sql, autoGeneratedKeys.intValue());
}
}
@@ -598,8 +595,7 @@ public class PStmtKey {
private class PreparedStatementWithColumnIndexes implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql, columnIndexes);
- return statement;
+ return connection.prepareStatement(sql, columnIndexes);
}
}
@@ -609,9 +605,7 @@ public class PStmtKey {
private class PreparedStatementWithResultSetConcurrency implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql, resultSetType.intValue(),
- resultSetConcurrency.intValue());
- return statement;
+ return connection.prepareStatement(sql, resultSetType.intValue(), resultSetConcurrency.intValue());
}
}
@@ -621,9 +615,8 @@ public class PStmtKey {
private class PreparedStatementWithResultSetHoldability implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql, resultSetType.intValue(),
- resultSetConcurrency.intValue(), resultSetHoldability.intValue());
- return statement;
+ return connection.prepareStatement(sql, resultSetType.intValue(), resultSetConcurrency.intValue(),
+ resultSetHoldability.intValue());
}
}
@@ -633,8 +626,7 @@ public class PStmtKey {
private class PreparedStatementWithColumnNames implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareStatement(sql, columnNames);
- return statement;
+ return connection.prepareStatement(sql, columnNames);
}
}
@@ -644,8 +636,7 @@ public class PStmtKey {
private class PreparedCallSQL implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareCall(sql);
- return statement;
+ return connection.prepareCall(sql);
}
}
@@ -655,9 +646,7 @@ public class PStmtKey {
private class PreparedCallWithResultSetConcurrency implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareCall(sql, resultSetType.intValue(),
- resultSetConcurrency.intValue());
- return statement;
+ return connection.prepareCall(sql, resultSetType.intValue(), resultSetConcurrency.intValue());
}
}
@@ -667,9 +656,8 @@ public class PStmtKey {
private class PreparedCallWithResultSetHoldability implements StatementBuilder {
@Override
public Statement createStatement(final Connection connection) throws SQLException {
- final PreparedStatement statement = connection.prepareCall(sql, resultSetType.intValue(),
- resultSetConcurrency.intValue(), resultSetHoldability.intValue());
- return statement;
+ return connection.prepareCall(sql, resultSetType.intValue(), resultSetConcurrency.intValue(),
+ resultSetHoldability.intValue());
}
}
}
