public void testBug20650() throws Exception {
  Connection closedConn=null;
  Statement cancelStmt=null;
  try {
    closedConn=getConnectionWithProps((String)null);
    cancelStmt=closedConn.createStatement();
    closedConn.close();
    cancelStmt.cancel();
  }
  finally {
    if (cancelStmt != null) {
      cancelStmt.close();
    }
    if (closedConn != null && !closedConn.isClosed()) {
      closedConn.close();
    }
  }
}

public void testBug20650 ( ) throws Exception { Connection closedConn = null ; Statement cancelStmt = null ; try { closedConn = getConnectionWithProps ( ( String ) null ) ; cancelStmt = closedConn . createStatement ( ) ; closedConn . close ( ) ; cancelStmt . cancel ( ) ; } finally { if ( cancelStmt != null ) { cancelStmt . close ( ) ; } if ( closedConn != null && ! closedConn . isClosed ( ) ) { closedConn . close ( ) ; } } }
tests fix for bug # 20650 - statement . cancel ( ) causes nullpointerexception if underlying connection has been closed due to server failure .
