Search in sources :

Example 1 with ConnectionWrapper

use of com.mysql.cj.jdbc.ConnectionWrapper in project aws-mysql-jdbc by awslabs.

the class PooledConnectionRegressionTest method testPacketTooLargeException.

/**
 * Tests that PacketTooLargeException doesn't clober the connection.
 *
 * @throws Exception
 */
@Test
public void testPacketTooLargeException() throws Exception {
    final ConnectionEventListener conListener = new ConnectionListener();
    PooledConnection pc = null;
    pc = this.cpds.getPooledConnection();
    pc.addConnectionEventListener(conListener);
    createTable("testPacketTooLarge", "(field1 LONGBLOB)");
    Connection connFromPool = pc.getConnection();
    PreparedStatement pstmtFromPool = ((ConnectionWrapper) connFromPool).clientPrepare("INSERT INTO testPacketTooLarge VALUES (?)");
    this.rs = this.stmt.executeQuery("SHOW VARIABLES LIKE 'max_allowed_packet'");
    this.rs.next();
    int maxAllowedPacket = this.rs.getInt(2);
    int numChars = (int) (maxAllowedPacket * 1.2);
    pstmtFromPool.setBinaryStream(1, new BufferedInputStream(new FileInputStream(newTempBinaryFile("testPacketTooLargeException", numChars))), numChars);
    assertThrows(PacketTooBigException.class, () -> {
        pstmtFromPool.executeUpdate();
        return null;
    });
    // This should still work okay, even though the last query on the same connection didn't...
    this.rs = connFromPool.createStatement().executeQuery("SELECT 1");
    assertEquals(0, this.connectionErrorEventCount);
    assertEquals(0, this.closeEventCount);
}
Also used : PooledConnection(javax.sql.PooledConnection) BufferedInputStream(java.io.BufferedInputStream) Connection(java.sql.Connection) PooledConnection(javax.sql.PooledConnection) JdbcConnection(com.mysql.cj.jdbc.JdbcConnection) ConnectionWrapper(com.mysql.cj.jdbc.ConnectionWrapper) PreparedStatement(java.sql.PreparedStatement) FileInputStream(java.io.FileInputStream) ConnectionEventListener(javax.sql.ConnectionEventListener) Test(org.junit.jupiter.api.Test)

Example 2 with ConnectionWrapper

use of com.mysql.cj.jdbc.ConnectionWrapper in project aws-mysql-jdbc by awslabs.

the class PooledConnectionRegressionTest method testConnectionWrapperMethods.

@SuppressWarnings("deprecation")
@Test
public void testConnectionWrapperMethods() throws Exception {
    PooledConnection pc = null;
    pc = this.cpds.getPooledConnection();
    ConnectionWrapper cw = (ConnectionWrapper) pc.getConnection();
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepare("SELECT 1").getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepare("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1").getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1", Statement.RETURN_GENERATED_KEYS).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1", new int[] { 1 }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1", new String[] { "1" }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.clientPrepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1").getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1", Statement.RETURN_GENERATED_KEYS).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1", new int[] { 1 }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1", new String[] { "1" }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.serverPrepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1").getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1", Statement.RETURN_GENERATED_KEYS).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1", new int[] { 1 }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1", new String[] { "1" }).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(PreparedStatementWrapper.class, cw.prepareStatement("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT).getClass());
    assertEquals(CallableStatementWrapper.class, cw.prepareCall("SELECT 1").getClass());
    assertEquals(CallableStatementWrapper.class, cw.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(CallableStatementWrapper.class, cw.prepareCall("SELECT 1", ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT).getClass());
    assertEquals(StatementWrapper.class, cw.createStatement().getClass());
    assertEquals(StatementWrapper.class, cw.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY).getClass());
    assertEquals(StatementWrapper.class, cw.createStatement(ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, ResultSet.CLOSE_CURSORS_AT_COMMIT).getClass());
    assertEquals(26, cw.getActiveStatementCount());
    assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {

        public Void call() throws Exception {
            cw.createArrayOf(String.class.getName(), new Object[] {}).getClass();
            return null;
        }
    });
    assertThrows(SQLFeatureNotSupportedException.class, new Callable<Void>() {

        public Void call() throws Exception {
            cw.createStruct(String.class.getName(), new Object[] {}).getClass();
            return null;
        }
    });
    assertEquals(Blob.class, cw.createBlob().getClass());
    assertEquals(Clob.class, cw.createClob().getClass());
    assertEquals(NClob.class, cw.createNClob().getClass());
    assertEquals(MysqlSQLXML.class, cw.createSQLXML().getClass());
    assertEquals(ConnectionImpl.class, cw.getActiveMySQLConnection().getClass());
    assertEquals(this.conn.getAutoCommit(), cw.getAutoCommit());
    assertEquals(((JdbcConnection) this.conn).getAutoIncrementIncrement(), cw.getAutoIncrementIncrement());
    assertEquals(((JdbcConnection) this.conn).getCatalog(), cw.getCatalog());
    assertEquals(((JdbcConnection) this.conn).getCharacterSetMetadata(), cw.getCharacterSetMetadata());
    assertEquals(((JdbcConnection) this.conn).getHoldability(), cw.getHoldability());
    assertEquals(((JdbcConnection) this.conn).getHost(), cw.getHost());
    assertEquals(((JdbcConnection) this.conn).getHostPortPair(), cw.getHostPortPair());
    assertEquals(Properties.class, cw.getProperties().getClass());
    assertEquals(JdbcPropertySetImpl.class, cw.getPropertySet().getClass());
    assertEquals(((JdbcConnection) this.conn).getSchema(), cw.getSchema());
    assertEquals(((JdbcConnection) this.conn).getServerVersion().toString(), cw.getServerVersion().toString());
    assertEquals(NativeSession.class, cw.getSession().getClass());
    assertEquals(((JdbcConnection) this.conn).getSessionMaxRows(), cw.getSessionMaxRows());
    assertEquals(((JdbcConnection) this.conn).getURL(), cw.getURL());
    assertEquals(((JdbcConnection) this.conn).getUser(), cw.getUser());
    assertFalse(cw.hasTriedMaster());
    assertFalse(cw.isClosed());
    assertFalse(cw.isInGlobalTx());
    assertFalse(cw.isSourceConnection());
    assertFalse(cw.isProxySet());
    assertFalse(cw.isReadOnly());
    assertFalse(cw.isReadOnly(false));
    assertFalse(cw.isReadOnly(true));
    assertEquals(isMysqlRunningLocally(), cw.isServerLocal());
    assertTrue(cw.isValid(10));
    assertTrue(cw.isWrapperFor(Connection.class));
    assertEquals(((JdbcConnection) this.conn).lowerCaseTableNames(), cw.lowerCaseTableNames());
    assertEquals(CommentClientInfoProvider.class, cw.getClientInfoProviderImpl().getClass());
    Properties ci1 = new Properties();
    ci1.setProperty("k1", "v1");
    ci1.setProperty("k2", "v2");
    cw.setClientInfo(ci1);
    cw.setClientInfo("k3", "v3");
    Properties ci2 = cw.getClientInfo();
    assertFalse(ci1.equals(ci2));
    assertEquals("v1", cw.getClientInfo("k1"));
    assertEquals("v2", cw.getClientInfo("k2"));
    assertEquals("v3", cw.getClientInfo("k3"));
    String comment = cw.getStatementComment();
    assertEquals("k3=v3, k2=v2, k1=v1", comment);
    cw.setStatementComment("Test comment");
    assertNotEquals(((JdbcConnection) this.conn).getStatementComment(), cw.getStatementComment());
    assertEquals(ConnectionImpl.class, cw.getConnectionMutex().getClass());
    assertNull(cw.getExceptionInterceptor());
    assertEquals(((JdbcConnection) this.conn).getNetworkTimeout(), cw.getNetworkTimeout());
    assertEquals(((JdbcConnection) this.conn).getTypeMap(), cw.getTypeMap());
    assertNull(cw.getWarnings());
    // testsuite is built upon non-SSL default connection with additional useSSL=false&allowPublicKeyRetrieval=true properties
    assertFalse(cw.hasSameProperties((JdbcConnection) this.conn));
    assertTrue(cw.isSameResource((JdbcConnection) this.conn));
    assertEquals(((JdbcConnection) this.conn).nativeSQL("SELECT 1"), cw.nativeSQL("SELECT 1"));
    assertEquals(cw.getServerVersion().meetsMinimum(new ServerVersion(8, 0, 3)) ? DatabaseMetaDataUsingInfoSchema.class : DatabaseMetaData.class, cw.getMetaData().getClass());
    // TODO find a way to test following methods
    // cw.getId();
    // cw.getIdleFor();
    // cw.getMetadataSafeStatement();
    // cw.getMultiHostSafeProxy();
    // cw.resetServerState();
    cw.setCatalog(this.dbName);
    cw.setFailedOver(false);
    cw.setHoldability(ResultSet.CLOSE_CURSORS_AT_COMMIT);
    cw.setInGlobalTx(false);
    // TODO find a way to test following methods
    // cw.setNetworkTimeout(executor, milliseconds);
    // cw.setProxy(this.conn);
    // cw.setReadOnly(readOnly);
    // cw.setReadOnlyInternal(readOnlyFlag);
    // cw.setSchema(schema);
    // cw.setSessionMaxRows(max);
    // cw.setTypeMap(map);
    assertEquals(((JdbcConnection) this.conn).storesLowerCaseTableName(), cw.storesLowerCaseTableName());
    // TODO find a way to test following methods
    // cw.getQueryInterceptorsInstances();
    // cw.initializeSafeQueryInterceptors();
    // cw.unSafeQueryInterceptors();
    // cw.unwrap(iface);
    // cw.initializeResultsMetadataFromCache(sql, cachedMetaData, resultSet);
    // cw.getCachedMetaData(sql);
    cw.setAutoCommit(false);
    cw.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);
    assertEquals(Connection.TRANSACTION_READ_UNCOMMITTED, cw.getTransactionIsolation());
    cw.setTransactionIsolation(Connection.TRANSACTION_READ_COMMITTED);
    assertEquals(Connection.TRANSACTION_READ_COMMITTED, cw.getTransactionIsolation());
    // TODO find a way to test following methods
    // cw.transactionBegun();
    // cw.transactionCompleted();
    // cw.commit();
    // cw.rollback();
    // cw.rollback(arg0);
    // cw.setSavepoint();
    // cw.setSavepoint(arg0);
    // cw.releaseSavepoint(arg0);
    cw.setAutoCommit(true);
    // TODO find a way to test following methods
    // cw.registerStatement(this.stmt);
    // cw.unregisterStatement(this.stmt);
    // cw.decachePreparedStatement(this.pstmt);
    // cw.recachePreparedStatement(this.pstmt);
    // TODO find a way to test following methods
    // cw.clearHasTriedMaster();
    // cw.clearWarnings();
    // cw.ping();
    // cw.pingInternal(checkForClosedConnection, timeoutMillis);
    // cw.createNewIO(isForReconnect);
    // cw.changeUser(userName, newPassword);
    // cw.checkClosed();
    cw.close();
    // TODO why are they still active? Active statements should be cleaned when connection is returned to pool.
    assertEquals(26, cw.getActiveStatementCount());
    checkConnectionReturnedToPool(cw);
    cw.normalClose();
    assertEquals(0, cw.getActiveStatementCount());
    checkReallyClosedConnection(cw);
// TODO find a way to test following methods
// cw.realClose(calledExplicitly, issueRollback, skipLocalTeardown, reason);
// cw.cleanup(whyCleanedUp);
// cw.abort(executor);
// cw.abortInternal();
}
Also used : PooledConnection(javax.sql.PooledConnection) ServerVersion(com.mysql.cj.ServerVersion) DatabaseMetaDataUsingInfoSchema(com.mysql.cj.jdbc.DatabaseMetaDataUsingInfoSchema) ConnectionWrapper(com.mysql.cj.jdbc.ConnectionWrapper) Connection(java.sql.Connection) PooledConnection(javax.sql.PooledConnection) JdbcConnection(com.mysql.cj.jdbc.JdbcConnection) JdbcConnection(com.mysql.cj.jdbc.JdbcConnection) Properties(java.util.Properties) DatabaseMetaData(com.mysql.cj.jdbc.DatabaseMetaData) SQLFeatureNotSupportedException(java.sql.SQLFeatureNotSupportedException) SQLException(java.sql.SQLException) CommunicationsException(com.mysql.cj.jdbc.exceptions.CommunicationsException) PacketTooBigException(com.mysql.cj.jdbc.exceptions.PacketTooBigException) SQLNonTransientConnectionException(java.sql.SQLNonTransientConnectionException) Test(org.junit.jupiter.api.Test)

Example 3 with ConnectionWrapper

use of com.mysql.cj.jdbc.ConnectionWrapper in project aws-mysql-jdbc by awslabs.

the class CallableStatementTest method testClosedWrapper.

@SuppressWarnings("deprecation")
@Test
public void testClosedWrapper() throws Exception {
    String sql = "SELECT 1";
    int autoGeneratedKeys = 0;
    int[] columnIndexes = new int[] { 0 };
    String[] columnNames = new String[] { "f1" };
    int parameterIndex = 1;
    String parameterName = "p1";
    Calendar cal = new GregorianCalendar();
    Map<String, Class<?>> typeMap = new HashMap<>();
    typeMap.put("1", String.class);
    int scale = 3;
    String typeName = String.class.getName();
    InputStream istr = new InputStream() {

        @Override
        public int read() throws IOException {
            return 0;
        }
    };
    Reader reader = new StringReader(sql);
    MysqlPooledConnection con = new MysqlPooledConnection((JdbcConnection) this.conn);
    CallableStatementWrapper w = new CallableStatementWrapper(new ConnectionWrapper(con, (JdbcConnection) this.conn, false), con, null);
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.addBatch();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.addBatch(sql);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.cancel();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.clearBatch();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.clearParameters();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.clearWarnings();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.closeOnCompletion();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.enableStreamingResults();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.execute();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.execute("SELECT 1");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.execute(sql, autoGeneratedKeys);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.execute(sql, columnIndexes);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.execute(sql, columnNames);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeBatch();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeBatch();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeUpdate();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeUpdate(sql);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeUpdate(sql, autoGeneratedKeys);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeUpdate(sql, columnIndexes);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeLargeUpdate(sql, columnNames);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeQuery();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeQuery(sql);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeUpdate();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeUpdate(sql);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeUpdate(sql, autoGeneratedKeys);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeUpdate(sql, columnIndexes);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.executeUpdate(sql, columnNames);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getArray(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getArray(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBigDecimal(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBigDecimal(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBigDecimal(parameterIndex, 10);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBlob(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBlob(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBoolean(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBoolean(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getByte(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getByte(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getBytes(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getCharacterStream(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getCharacterStream(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getClob(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getClob(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDate(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDate(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDate(parameterIndex, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDate(parameterName, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDouble(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getDouble(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getFloat(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getFloat(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getInt(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getInt(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getLong(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getLong(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNCharacterStream(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNCharacterStream(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNClob(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNClob(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNString(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getNString(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterIndex, String.class);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterName, String.class);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterIndex, typeMap);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getObject(parameterName, typeMap);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getParameterMetaData();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getQueryTimeout();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getRef(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getRef(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getResultSet();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getResultSetConcurrency();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getResultSetHoldability();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getResultSetType();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getRowId(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getRowId(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getShort(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getShort(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getSQLXML(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getSQLXML(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getString(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getString(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTime(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTime(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTime(parameterIndex, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTime(parameterName, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTimestamp(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTimestamp(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTimestamp(parameterIndex, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getTimestamp(parameterName, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getUpdateCount();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getURL(parameterIndex);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getURL(parameterName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getWarnings();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getConnection();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getFetchDirection();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getFetchSize();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getGeneratedKeys();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getLargeMaxRows();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getLargeUpdateCount();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getMaxFieldSize();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getMaxRows();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getMetaData();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getMoreResults();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.getMoreResults(0);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.isClosed();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.isCloseOnCompletion();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.isPoolable();
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, MysqlType.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, MysqlType.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, Types.VARCHAR, scale);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, MysqlType.VARCHAR, scale);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, Types.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterIndex, MysqlType.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, Types.VARCHAR, scale);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, Types.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, MysqlType.VARCHAR, scale);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.registerOutParameter(parameterName, MysqlType.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setArray(parameterIndex, (java.sql.Array) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterIndex, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterName, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterIndex, istr, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterIndex, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterName, istr, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setAsciiStream(parameterName, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBigDecimal(parameterIndex, BigDecimal.valueOf(1L));
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBigDecimal(parameterName, BigDecimal.valueOf(1L));
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterIndex, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterName, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterIndex, istr, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterIndex, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterName, istr, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBinaryStream(parameterName, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterIndex, (Blob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterIndex, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterName, (Blob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterName, istr);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterIndex, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBlob(parameterName, istr, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBoolean(parameterIndex, true);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBoolean(parameterName, true);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setByte(parameterIndex, (byte) 0);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setByte(parameterName, (byte) 0);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBytes(parameterIndex, (byte[]) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setBytes(parameterName, (byte[]) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterIndex, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterName, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterIndex, reader, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterIndex, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterName, reader, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCharacterStream(parameterName, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterIndex, (Clob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterIndex, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterName, (Clob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterName, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterIndex, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setClob(parameterName, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setCursorName("qqq");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDate(parameterIndex, (Date) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDate(parameterName, (Date) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDate(parameterIndex, (Date) null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDate(parameterName, (Date) null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDouble(parameterIndex, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setDouble(parameterName, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setEscapeProcessing(true);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setFetchDirection(ResultSet.FETCH_FORWARD);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setFetchSize(1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setFloat(parameterIndex, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setFloat(parameterName, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setInt(parameterIndex, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setInt(parameterName, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setLargeMaxRows(1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setLong(parameterIndex, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setLong(parameterName, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setMaxFieldSize(1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setMaxRows(1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNCharacterStream(parameterIndex, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNCharacterStream(parameterName, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNCharacterStream(parameterIndex, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNCharacterStream(parameterName, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterIndex, (NClob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterIndex, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterName, (NClob) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterName, reader);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterIndex, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNClob(parameterName, reader, 1L);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNString(parameterIndex, "");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNString(parameterName, "");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNull(parameterIndex, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNull(parameterName, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNull(parameterIndex, Types.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setNull(parameterName, Types.VARCHAR, typeName);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterIndex, (Object) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterName, (Object) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterIndex, (Object) null, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterIndex, (Object) null, MysqlType.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterName, (Object) null, Types.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterName, (Object) null, MysqlType.VARCHAR);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterIndex, (Object) null, Types.VARCHAR, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterIndex, (Object) null, MysqlType.VARCHAR, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterName, (Object) null, Types.VARCHAR, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setObject(parameterName, (Object) null, MysqlType.VARCHAR, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setPoolable(true);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setQueryTimeout(5);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setRef(parameterIndex, (Ref) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setRowId(parameterIndex, (RowId) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setRowId(parameterName, (RowId) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setShort(parameterIndex, (short) 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setShort(parameterName, (short) 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setSQLXML(parameterIndex, (SQLXML) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setSQLXML(parameterName, (SQLXML) null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setString(parameterIndex, "");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setString(parameterName, "");
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTime(parameterIndex, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTime(parameterName, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTime(parameterIndex, null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTime(parameterName, null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTimestamp(parameterIndex, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTimestamp(parameterName, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTimestamp(parameterIndex, null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setTimestamp(parameterName, null, cal);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setUnicodeStream(parameterIndex, istr, 1);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setURL(parameterIndex, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.setURL(parameterName, null);
            return null;
        }
    });
    assertThrows(SQLException.class, "No operations allowed after statement closed.", new Callable<Void>() {

        public Void call() throws Exception {
            w.wasNull();
            return null;
        }
    });
    w.close();
}
Also used : NClob(java.sql.NClob) RowId(java.sql.RowId) HashMap(java.util.HashMap) Reader(java.io.Reader) StringReader(java.io.StringReader) JdbcConnection(com.mysql.cj.jdbc.JdbcConnection) CallableStatementWrapper(com.mysql.cj.jdbc.CallableStatementWrapper) StringReader(java.io.StringReader) ConnectionWrapper(com.mysql.cj.jdbc.ConnectionWrapper) MysqlPooledConnection(com.mysql.cj.jdbc.MysqlPooledConnection) Blob(java.sql.Blob) InputStream(java.io.InputStream) Calendar(java.util.Calendar) GregorianCalendar(java.util.GregorianCalendar) GregorianCalendar(java.util.GregorianCalendar) SQLException(java.sql.SQLException) IOException(java.io.IOException) Date(java.sql.Date) Ref(java.sql.Ref) SQLXML(java.sql.SQLXML) NClob(java.sql.NClob) Clob(java.sql.Clob) Test(org.junit.jupiter.api.Test)

Aggregations

ConnectionWrapper (com.mysql.cj.jdbc.ConnectionWrapper)3 JdbcConnection (com.mysql.cj.jdbc.JdbcConnection)3 Test (org.junit.jupiter.api.Test)3 Connection (java.sql.Connection)2 SQLException (java.sql.SQLException)2 PooledConnection (javax.sql.PooledConnection)2 ServerVersion (com.mysql.cj.ServerVersion)1 CallableStatementWrapper (com.mysql.cj.jdbc.CallableStatementWrapper)1 DatabaseMetaData (com.mysql.cj.jdbc.DatabaseMetaData)1 DatabaseMetaDataUsingInfoSchema (com.mysql.cj.jdbc.DatabaseMetaDataUsingInfoSchema)1 MysqlPooledConnection (com.mysql.cj.jdbc.MysqlPooledConnection)1 CommunicationsException (com.mysql.cj.jdbc.exceptions.CommunicationsException)1 PacketTooBigException (com.mysql.cj.jdbc.exceptions.PacketTooBigException)1 BufferedInputStream (java.io.BufferedInputStream)1 FileInputStream (java.io.FileInputStream)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 Blob (java.sql.Blob)1