mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
修正动态修改PoolPreparedStatement参数的错误
This commit is contained in:
@@ -155,7 +155,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
try {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareStatement(sql));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -190,7 +192,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareStatement(sql, resultSetType,
|
||||
resultSetConcurrency));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -226,7 +230,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
resultSetConcurrency,
|
||||
resultSetHoldability));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -258,7 +264,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
try {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareStatement(sql, columnIndexes));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -290,7 +298,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
try {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareStatement(sql, columnNames));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -322,7 +332,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
try {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareStatement(sql, autoGeneratedKeys));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -357,7 +369,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
try {
|
||||
stmtHolder = new PreparedStatementHolder(key, conn.prepareCall(sql));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -392,7 +406,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
resultSetConcurrency,
|
||||
resultSetHoldability));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
@@ -425,7 +441,9 @@ public class PoolableConnection implements PooledConnection, Connection {
|
||||
stmtHolder = new PreparedStatementHolder(key,
|
||||
conn.prepareCall(sql, resultSetType, resultSetConcurrency));
|
||||
holder.getDataSource().incrementPreparedStatementCount();
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
if (holder.isPoolPreparedStatements()) {
|
||||
holder.getStatementPool().put(stmtHolder);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
handleException(ex);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user