mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
添加checkOpen
git-svn-id: http://code.alibabatech.com/svn/druid/trunk@479 b9813039-fb51-4c41-a8b9-e21c2acb5095
This commit is contained in:
@@ -80,9 +80,12 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
void setClosed(boolean value) {
|
||||
this.closed = value;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ResultSet executeQuery() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
ResultSet rs = stmt.executeQuery();
|
||||
|
||||
@@ -97,6 +100,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public int executeUpdate() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate();
|
||||
} catch (Throwable t) {
|
||||
@@ -106,6 +111,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNull(int parameterIndex, int sqlType) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNull(parameterIndex, sqlType);
|
||||
} catch (Throwable t) {
|
||||
@@ -115,6 +122,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBoolean(int parameterIndex, boolean x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBoolean(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -124,6 +133,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setByte(int parameterIndex, byte x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setByte(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -133,6 +144,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setShort(int parameterIndex, short x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setShort(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -142,6 +155,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setInt(int parameterIndex, int x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setInt(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -151,6 +166,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setLong(int parameterIndex, long x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setLong(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -160,6 +177,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setFloat(int parameterIndex, float x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setFloat(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -169,6 +188,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setDouble(int parameterIndex, double x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setDouble(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -178,6 +199,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBigDecimal(int parameterIndex, BigDecimal x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBigDecimal(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -187,6 +210,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setString(int parameterIndex, String x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setString(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -196,6 +221,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBytes(int parameterIndex, byte[] x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBytes(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -205,6 +232,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setDate(int parameterIndex, Date x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setDate(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -214,6 +243,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setTime(int parameterIndex, Time x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setTime(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -223,6 +254,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setTimestamp(int parameterIndex, Timestamp x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setTimestamp(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -232,6 +265,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setAsciiStream(int parameterIndex, InputStream x, int length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setAsciiStream(parameterIndex, x, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -242,6 +277,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
@Override
|
||||
@Deprecated
|
||||
public void setUnicodeStream(int parameterIndex, InputStream x, int length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setUnicodeStream(parameterIndex, x, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -251,6 +288,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBinaryStream(int parameterIndex, InputStream x, int length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBinaryStream(parameterIndex, x, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -260,6 +299,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void clearParameters() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.clearParameters();
|
||||
} catch (Throwable t) {
|
||||
@@ -269,6 +310,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setObject(int parameterIndex, Object x, int targetSqlType) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setObject(parameterIndex, x, targetSqlType);
|
||||
} catch (Throwable t) {
|
||||
@@ -278,6 +321,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setObject(int parameterIndex, Object x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setObject(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -287,6 +332,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public boolean execute() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.execute();
|
||||
} catch (Throwable t) {
|
||||
@@ -296,6 +343,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void addBatch() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.addBatch();
|
||||
} catch (Throwable t) {
|
||||
@@ -305,6 +354,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setCharacterStream(int parameterIndex, Reader reader, int length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setCharacterStream(parameterIndex, reader, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -314,6 +365,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setRef(int parameterIndex, Ref x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setRef(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -323,6 +376,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBlob(int parameterIndex, Blob x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBlob(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -332,6 +387,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setClob(int parameterIndex, Clob x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setClob(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -341,6 +398,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setArray(int parameterIndex, Array x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setArray(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -350,6 +409,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public ResultSetMetaData getMetaData() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getMetaData();
|
||||
} catch (Throwable t) {
|
||||
@@ -359,6 +420,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setDate(int parameterIndex, Date x, Calendar cal) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setDate(parameterIndex, x, cal);
|
||||
} catch (Throwable t) {
|
||||
@@ -368,6 +431,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setTime(int parameterIndex, Time x, Calendar cal) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setTime(parameterIndex, x, cal);
|
||||
} catch (Throwable t) {
|
||||
@@ -377,6 +442,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setTimestamp(int parameterIndex, Timestamp x, Calendar cal) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setTimestamp(parameterIndex, x, cal);
|
||||
} catch (Throwable t) {
|
||||
@@ -386,6 +453,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNull(int parameterIndex, int sqlType, String typeName) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNull(parameterIndex, sqlType, typeName);
|
||||
} catch (Throwable t) {
|
||||
@@ -395,6 +464,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setURL(int parameterIndex, URL x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setURL(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -404,6 +475,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public ParameterMetaData getParameterMetaData() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getParameterMetaData();
|
||||
} catch (Throwable t) {
|
||||
@@ -413,6 +486,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setRowId(int parameterIndex, RowId x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setRowId(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -422,6 +497,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNString(int parameterIndex, String value) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNString(parameterIndex, value);
|
||||
} catch (Throwable t) {
|
||||
@@ -431,6 +508,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNCharacterStream(int parameterIndex, Reader value, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNCharacterStream(parameterIndex, value, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -440,6 +519,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNClob(int parameterIndex, NClob value) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNClob(parameterIndex, value);
|
||||
} catch (Throwable t) {
|
||||
@@ -449,6 +530,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setClob(int parameterIndex, Reader reader, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setClob(parameterIndex, reader, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -458,6 +541,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBlob(int parameterIndex, InputStream inputStream, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBlob(parameterIndex, inputStream, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -467,6 +552,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNClob(int parameterIndex, Reader reader, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNClob(parameterIndex, reader, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -476,6 +563,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setSQLXML(parameterIndex, xmlObject);
|
||||
} catch (Throwable t) {
|
||||
@@ -485,6 +574,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setObject(int parameterIndex, Object x, int targetSqlType, int scaleOrLength) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setObject(parameterIndex, x, targetSqlType, scaleOrLength);
|
||||
} catch (Throwable t) {
|
||||
@@ -494,6 +585,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setAsciiStream(int parameterIndex, InputStream x, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setAsciiStream(parameterIndex, x, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -503,6 +596,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBinaryStream(int parameterIndex, InputStream x, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBinaryStream(parameterIndex, x, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -512,6 +607,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setCharacterStream(int parameterIndex, Reader reader, long length) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setCharacterStream(parameterIndex, reader, length);
|
||||
} catch (Throwable t) {
|
||||
@@ -521,6 +618,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setAsciiStream(int parameterIndex, InputStream x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setAsciiStream(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -530,6 +629,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBinaryStream(int parameterIndex, InputStream x) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBinaryStream(parameterIndex, x);
|
||||
} catch (Throwable t) {
|
||||
@@ -539,6 +640,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setCharacterStream(int parameterIndex, Reader reader) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setCharacterStream(parameterIndex, reader);
|
||||
} catch (Throwable t) {
|
||||
@@ -548,6 +651,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNCharacterStream(int parameterIndex, Reader value) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNCharacterStream(parameterIndex, value);
|
||||
} catch (Throwable t) {
|
||||
@@ -557,6 +662,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setClob(int parameterIndex, Reader reader) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setClob(parameterIndex, reader);
|
||||
} catch (Throwable t) {
|
||||
@@ -566,6 +673,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setBlob(int parameterIndex, InputStream inputStream) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setBlob(parameterIndex, inputStream);
|
||||
} catch (Throwable t) {
|
||||
@@ -575,6 +684,8 @@ public class PoolablePreparedStatement extends PoolableStatement implements Prep
|
||||
|
||||
@Override
|
||||
public void setNClob(int parameterIndex, Reader reader) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setNClob(parameterIndex, reader);
|
||||
} catch (Throwable t) {
|
||||
|
||||
@@ -61,6 +61,12 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
return stmt;
|
||||
}
|
||||
|
||||
protected void checkOpen() throws SQLException {
|
||||
if (closed) {
|
||||
throw new SQLException("statement is closed");
|
||||
}
|
||||
}
|
||||
|
||||
void clearResultSet() {
|
||||
for (ResultSet rs : resultSetTrace) {
|
||||
try {
|
||||
@@ -76,6 +82,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final ResultSet executeQuery(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
ResultSet rs = stmt.executeQuery(sql);
|
||||
|
||||
@@ -90,6 +98,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int executeUpdate(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql);
|
||||
} catch (Throwable t) {
|
||||
@@ -109,6 +119,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getMaxFieldSize() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getMaxFieldSize();
|
||||
} catch (Throwable t) {
|
||||
@@ -118,6 +130,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setMaxFieldSize(int max) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setMaxFieldSize(max);
|
||||
} catch (Throwable t) {
|
||||
@@ -127,6 +141,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getMaxRows() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getMaxRows();
|
||||
} catch (Throwable t) {
|
||||
@@ -136,6 +152,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setMaxRows(int max) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setMaxRows(max);
|
||||
} catch (Throwable t) {
|
||||
@@ -145,6 +163,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setEscapeProcessing(boolean enable) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setEscapeProcessing(enable);
|
||||
} catch (Throwable t) {
|
||||
@@ -154,6 +174,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getQueryTimeout() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getQueryTimeout();
|
||||
} catch (Throwable t) {
|
||||
@@ -163,6 +185,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setQueryTimeout(int seconds) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setQueryTimeout(seconds);
|
||||
} catch (Throwable t) {
|
||||
@@ -172,6 +196,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void cancel() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.cancel();
|
||||
} catch (Throwable t) {
|
||||
@@ -181,6 +207,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final SQLWarning getWarnings() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getWarnings();
|
||||
} catch (Throwable t) {
|
||||
@@ -190,6 +218,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void clearWarnings() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.clearWarnings();
|
||||
} catch (Throwable t) {
|
||||
@@ -199,6 +229,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setCursorName(String name) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setCursorName(name);
|
||||
} catch (Throwable t) {
|
||||
@@ -208,6 +240,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final boolean execute(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.execute(sql);
|
||||
} catch (Throwable t) {
|
||||
@@ -217,6 +251,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final ResultSet getResultSet() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
ResultSet rs = stmt.getResultSet();
|
||||
|
||||
@@ -231,6 +267,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getUpdateCount() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getUpdateCount();
|
||||
} catch (Throwable t) {
|
||||
@@ -240,6 +278,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final boolean getMoreResults() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getMoreResults();
|
||||
} catch (Throwable t) {
|
||||
@@ -249,6 +289,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setFetchDirection(int direction) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setFetchDirection(direction);
|
||||
} catch (Throwable t) {
|
||||
@@ -258,6 +300,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getFetchDirection() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getFetchDirection();
|
||||
} catch (Throwable t) {
|
||||
@@ -267,6 +311,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void setFetchSize(int rows) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.setFetchSize(rows);
|
||||
} catch (Throwable t) {
|
||||
@@ -276,6 +322,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getFetchSize() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getFetchSize();
|
||||
} catch (Throwable t) {
|
||||
@@ -285,6 +333,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getResultSetConcurrency() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getResultSetConcurrency();
|
||||
} catch (Throwable t) {
|
||||
@@ -294,6 +344,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getResultSetType() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getResultSetType();
|
||||
} catch (Throwable t) {
|
||||
@@ -303,6 +355,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void addBatch(String sql) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.addBatch(sql);
|
||||
} catch (Throwable t) {
|
||||
@@ -312,6 +366,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final void clearBatch() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
stmt.clearBatch();
|
||||
} catch (Throwable t) {
|
||||
@@ -321,6 +377,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int[] executeBatch() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeBatch();
|
||||
} catch (Throwable t) {
|
||||
@@ -330,11 +388,15 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final Connection getConnection() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
return conn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final boolean getMoreResults(int current) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getMoreResults(current);
|
||||
} catch (Throwable t) {
|
||||
@@ -344,6 +406,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final ResultSet getGeneratedKeys() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
ResultSet rs = stmt.getGeneratedKeys();
|
||||
|
||||
@@ -359,6 +423,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int executeUpdate(String sql, int autoGeneratedKeys) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, autoGeneratedKeys);
|
||||
} catch (Throwable t) {
|
||||
@@ -368,6 +434,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int executeUpdate(String sql, int columnIndexes[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, columnIndexes);
|
||||
} catch (Throwable t) {
|
||||
@@ -377,6 +445,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int executeUpdate(String sql, String columnNames[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.executeUpdate(sql, columnNames);
|
||||
} catch (Throwable t) {
|
||||
@@ -386,6 +456,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final boolean execute(String sql, int autoGeneratedKeys) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, autoGeneratedKeys);
|
||||
} catch (Throwable t) {
|
||||
@@ -395,6 +467,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final boolean execute(String sql, int columnIndexes[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, columnIndexes);
|
||||
} catch (Throwable t) {
|
||||
@@ -404,6 +478,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final boolean execute(String sql, String columnNames[]) throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.execute(sql, columnNames);
|
||||
} catch (Throwable t) {
|
||||
@@ -413,6 +489,8 @@ public class PoolableStatement extends PoolableWrapper implements Statement {
|
||||
|
||||
@Override
|
||||
public final int getResultSetHoldability() throws SQLException {
|
||||
checkOpen();
|
||||
|
||||
try {
|
||||
return stmt.getResultSetHoldability();
|
||||
} catch (Throwable t) {
|
||||
|
||||
Reference in New Issue
Block a user